fix(core): Do not applying auth if UM is disabled (#3218)
* 🔓 not applying auth if UM is disabled * 🛠 add helpers for UM enabled/disabled * 👕 fix lint issue * 🔥 remove unused imports
This commit is contained in:
@@ -32,6 +32,20 @@ export function isEmailSetUp(): boolean {
|
||||
return smtp && host && user && pass;
|
||||
}
|
||||
|
||||
export function isUserManagementEnabled(): boolean {
|
||||
return (
|
||||
!config.getEnv('userManagement.disabled') ||
|
||||
config.getEnv('userManagement.isInstanceOwnerSetUp')
|
||||
);
|
||||
}
|
||||
|
||||
export function isUserManagementDisabled(): boolean {
|
||||
return (
|
||||
config.getEnv('userManagement.disabled') &&
|
||||
!config.getEnv('userManagement.isInstanceOwnerSetUp')
|
||||
);
|
||||
}
|
||||
|
||||
async function getInstanceOwnerRole(): Promise<Role> {
|
||||
const ownerRole = await Db.collections.Role.findOneOrFail({
|
||||
where: {
|
||||
|
||||
Reference in New Issue
Block a user