mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 21:40:31 +00:00
modified backend controllers to support new auth providers
This commit is contained in:
@@ -390,10 +390,13 @@ export const validateProviderAuthToken = async ({
|
||||
jwt.verify(providerAuthToken, await getJwtProviderAuthSecret())
|
||||
);
|
||||
|
||||
const doesProviderMatch = (user.authProvider && user.authProvider === decodedToken.authProvider)
|
||||
|| (user.authProviders && user.authProviders.includes(decodedToken.authProvider));
|
||||
|
||||
if (
|
||||
decodedToken.authProvider !== user.authProvider ||
|
||||
!doesProviderMatch ||
|
||||
decodedToken.email !== email
|
||||
) {
|
||||
throw new Error("Invalid authentication credentials.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user