Skip to content

Commit

Permalink
fix: Do not forward to a disabled authentication provider when attemp…
Browse files Browse the repository at this point in the history
…ting to sign-in with email
  • Loading branch information
tommoor committed Sep 22, 2022
1 parent d825ed9 commit 62b4f52
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions server/routes/auth/providers/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 62b4f52

Please sign in to comment.