fix: Do not show authentication provider plugins that aren't enabled
This commit is contained in:
@@ -17,15 +17,22 @@ export default class AuthenticationHelper {
|
||||
return providerConfigs
|
||||
.sort((config) => (config.id === "email" ? 1 : -1))
|
||||
.filter((config) => {
|
||||
// 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 (config.id === "email") {
|
||||
return team?.emailSigninEnabled;
|
||||
// Don't return authentication methods that are not enabled.
|
||||
if (!config.enabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If no team return all possible authentication providers.
|
||||
if (!team) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Guest sign-in is an exception as it does not have an authentication
|
||||
// provider using passport, instead it exists as a boolean option.
|
||||
if (config.id === "email") {
|
||||
return team?.emailSigninEnabled;
|
||||
}
|
||||
|
||||
const authProvider = find(team.authenticationProviders, {
|
||||
name: config.id,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user