fix maxlen for pin
This commit is contained in:
2
mod.ts
2
mod.ts
@@ -99,7 +99,7 @@ Deno.serve({ port: config.api.port }, async (req) => {
|
|||||||
if (userNameMatches.length === 0) {
|
if (userNameMatches.length === 0) {
|
||||||
if (body.name.length < 4 || body.name.length > 20)
|
if (body.name.length < 4 || body.name.length > 20)
|
||||||
return genericResponse(STATUS_CODE.BadRequest, `Name too ${body.name.length < 4 ? 'short' : 'long'}.`);
|
return genericResponse(STATUS_CODE.BadRequest, `Name too ${body.name.length < 4 ? 'short' : 'long'}.`);
|
||||||
if (body.pin.length < 4 || body.pin.length > 20) return genericResponse(STATUS_CODE.BadRequest, `PIN too ${body.pin.length < 4 ? 'short' : 'long'}.`);
|
if (body.pin.length < 4 || body.pin.length > 16) return genericResponse(STATUS_CODE.BadRequest, `PIN too ${body.pin.length < 4 ? 'short' : 'long'}.`);
|
||||||
if (body.email.length > 255) return genericResponse(STATUS_CODE.BadRequest, 'Email too long.');
|
if (body.email.length > 255) return genericResponse(STATUS_CODE.BadRequest, 'Email too long.');
|
||||||
|
|
||||||
const id = nanoid();
|
const id = nanoid();
|
||||||
|
|||||||
Reference in New Issue
Block a user