Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Update auth-fns.ts

Daniel Hougaard9458c8b04f8a
diff --git a/backend/src/services/auth/auth-fns.ts b/backend/src/services/auth/auth-fns.ts
index c72f6c6a7d..ec6e0a3034 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;
};