From 9458c8b04f8a5a90f0a844f7d81e74c410ea87c0 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Mon, 10 Mar 2025 22:15:30 +0400 Subject: [PATCH] Update auth-fns.ts --- backend/src/services/auth/auth-fns.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/src/services/auth/auth-fns.ts b/backend/src/services/auth/auth-fns.ts index c72f6c6a7..ec6e0a303 100644 --- a/backend/src/services/auth/auth-fns.ts +++ b/backend/src/services/auth/auth-fns.ts @@ -66,6 +66,12 @@ export const validatePasswordResetAuthorization = (token?: string) => { const decodedToken = jwt.verify(AUTH_TOKEN_VALUE, appCfg.AUTH_SECRET) as AuthModeProviderSignUpTokenPayload; + if (decodedToken.authTokenType !== AuthTokenType.SIGNUP_TOKEN) { + throw new UnauthorizedError({ + message: `The provided authentication token type is not supported.` + }); + } + return decodedToken; };