config: switch to authMethod config for auth method selection

This commit is contained in:
Jesse Chan
2020-10-26 20:21:00 +08:00
parent 7e56cd99ac
commit ccb410d2e5
15 changed files with 64 additions and 34 deletions

View File

@@ -169,7 +169,7 @@ class Users {
}
lookupUser(username: string, callback: (err: Error | null, user?: UserInDatabase) => void): void {
if (config.disableUsersAndAuth) {
if (config.authMethod === 'none') {
return callback(null, this.getConfigUser());
}
@@ -185,7 +185,7 @@ class Users {
}
listUsers(callback: (users: Array<UserInDatabase> | null, err?: Error) => void): void {
if (config.disableUsersAndAuth) {
if (config.authMethod === 'none') {
return callback([this.getConfigUser()]);
}