From e295ae4c01c675db153011e21b915a65a809cf75 Mon Sep 17 00:00:00 2001 From: Anbraten Date: Fri, 20 Jan 2023 16:26:17 +0100 Subject: [PATCH] fix: correct api token length check (#29) --- packages/server/src/api/endpoints/project.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/endpoints/project.ts b/packages/server/src/api/endpoints/project.ts index be4bf83..ba75ba1 100644 --- a/packages/server/src/api/endpoints/project.ts +++ b/packages/server/src/api/endpoints/project.ts @@ -92,7 +92,7 @@ export function projectEndpoints(server: FastifyInstance): void { }); const apiToken = body.apiToken || (await generateApiToken()); - if (apiToken.length >= 32) { + if (apiToken.length < 32) { return reply.code(400).send({ error: 'Api token must be at least 32 characters long' }); }