Feat: Org Scoped JWT Tokens

This commit is contained in:
Daniel Hougaard
2024-03-17 18:48:10 +01:00
parent 8fc081973d
commit d287c3e152
8 changed files with 129 additions and 26 deletions
+2 -2
View File
@@ -15,10 +15,10 @@ export const validateProviderAuthToken = (providerToken: string, username?: stri
if (decodedToken.username !== username) throw new Error("Invalid auth credentials");
if (decodedToken.organizationId) {
return { orgId: decodedToken.organizationId };
return { orgId: decodedToken.organizationId, authMethod: decodedToken.authMethod };
}
return {};
return { authMethod: decodedToken.authMethod, orgId: null };
};
export const validateSignUpAuthorization = (token: string, userId: string, validate = true) => {