fix: Do not forward to a disabled authentication provider when attempting to sign-in with email

This commit is contained in:
Tom Moor
2022-09-22 07:27:03 -04:00
parent d825ed957d
commit 62b4f520de

View File

@@ -86,10 +86,12 @@ router.post(
const authProvider = find(team.authenticationProviders, {
id: user.authentications[0].authenticationProviderId,
});
ctx.body = {
redirect: `${team.url}/auth/${authProvider?.name}`,
};
return;
if (authProvider?.enabled) {
ctx.body = {
redirect: `${team.url}/auth/${authProvider?.name}`,
};
return;
}
}
if (!team.emailSigninEnabled) {