mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(core): Persist CurrentAuthenticationMethod setting change (#5762)
* limit user invites when saml is enabled * persist CurrentAuthenticationMethod
This commit is contained in:
committed by
GitHub
parent
57748b71e5
commit
4498c6013d
@@ -1,4 +1,5 @@
|
||||
import config from '@/config';
|
||||
import * as Db from '@/Db';
|
||||
import type { AuthProviderType } from '@/databases/entities/AuthIdentity';
|
||||
|
||||
export function isSamlCurrentAuthenticationMethod(): boolean {
|
||||
@@ -17,6 +18,12 @@ export function doRedirectUsersFromLoginToSsoFlow(): boolean {
|
||||
return config.getEnv('sso.redirectLoginToSso');
|
||||
}
|
||||
|
||||
export function setCurrentAuthenticationMethod(authenticationMethod: AuthProviderType): void {
|
||||
export async function setCurrentAuthenticationMethod(
|
||||
authenticationMethod: AuthProviderType,
|
||||
): Promise<void> {
|
||||
config.set('userManagement.authenticationMethod', authenticationMethod);
|
||||
await Db.collections.Settings.save({
|
||||
key: 'userManagement.authenticationMethod',
|
||||
value: authenticationMethod,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user