From 4bf05760322d336616f9bbc2a9396e157c423feb Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sun, 15 Jan 2023 19:40:49 +0100 Subject: [PATCH] Created the auth validation --- src/routes/v1/validations/auth.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/routes/v1/validations/auth.ts diff --git a/src/routes/v1/validations/auth.ts b/src/routes/v1/validations/auth.ts new file mode 100644 index 0000000..778ad2d --- /dev/null +++ b/src/routes/v1/validations/auth.ts @@ -0,0 +1,10 @@ +import Joi from "joi"; + +export const loginValidation = Joi.object({ + username: Joi.string().min(3).max(15).alphanum().required(), + password: Joi.string().min(5).max(50).required() +}); + +export const tokenValidation = Joi.object({ + token: Joi.string().hex().min(96).max(96).required() +}); \ No newline at end of file