fix: Automatically disable email sign-in when SMTP is not configured
fix: Do not show email signin as enabled when SMTP configured closes #3227
This commit is contained in:
@@ -17,7 +17,7 @@ function filterProviders(team: Team) {
|
||||
// guest sign-in is an exception as it does not have an authentication
|
||||
// provider using passport, instead it exists as a boolean option on the team
|
||||
if (provider.id === "email") {
|
||||
return team && team.guestSignin;
|
||||
return team?.emailSigninEnabled;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -92,7 +92,7 @@ router.post("email", errorHandling(), async (ctx) => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!team.guestSignin) {
|
||||
if (!team.emailSigninEnabled) {
|
||||
throw AuthorizationError();
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ router.get("email.callback", async (ctx) => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!user.team.guestSignin) {
|
||||
if (!user.team.emailSigninEnabled) {
|
||||
return ctx.redirect("/?notice=auth-error");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user