AD auth supports basic auth

This commit is contained in:
Jan Prochazka
2024-07-26 09:57:27 +02:00
parent 05329951f9
commit 8db941dc06
2 changed files with 17 additions and 16 deletions

View File

@@ -49,10 +49,6 @@ class AuthProviderBase {
return {};
}
getBasicAuthLogins() {
return null;
}
shouldAuthorizeApi() {
return false;
}
@@ -163,11 +159,11 @@ class ADProvider extends AuthProviderBase {
}
shouldAuthorizeApi() {
return true;
return !process.env.BASIC_AUTH;
}
isLoginForm() {
return true;
return !process.env.BASIC_AUTH;
}
}
@@ -186,13 +182,6 @@ class LoginsProvider extends AuthProviderBase {
return { error: 'Invalid credentials' };
}
getBasicAuthLogins() {
const logins = getEnvLogins();
if (logins && process.env.BASIC_AUTH) {
return _.fromPairs(logins.filter(x => x.password).map(x => [x.login, x.password]));
}
}
shouldAuthorizeApi() {
return !process.env.BASIC_AUTH;
}