Skip to content

Commit 3d63107

Browse files
committed
fix(authentication): wrong config checks
1 parent 58f3066 commit 3d63107

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

modules/authentication/src/handlers/username.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
RoutingManager,
1818
} from '@conduitplatform/module-tools';
1919
import { authenticateChecks, changePassword } from './utils.js';
20+
import { Config } from '../config/index.js';
2021

2122
export class UsernameHandlers implements IAuthenticationStrategy {
2223
constructor(private readonly grpcSdk: ConduitGrpcSdk) {}
@@ -64,12 +65,12 @@ export class UsernameHandlers implements IAuthenticationStrategy {
6465
}
6566

6667
async validate(): Promise<boolean> {
67-
const config = ConfigController.getInstance().config;
68-
if (config.local.username.enabled) {
69-
return Promise.resolve(true);
68+
const config: Config = ConfigController.getInstance().config;
69+
if (config.local.username_auth_enabled) {
70+
return true;
7071
} else {
7172
ConduitGrpcSdk.Logger.log('Username authentication not available');
72-
return Promise.resolve(false);
73+
return false;
7374
}
7475
}
7576

0 commit comments

Comments
 (0)