From 215398e873b2da338dabfedc98e0ca11e05d8691 Mon Sep 17 00:00:00 2001 From: Nevo David Date: Sun, 8 Jun 2025 23:12:12 +0700 Subject: [PATCH] feat: oidc fix --- apps/backend/src/services/auth/auth.service.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/backend/src/services/auth/auth.service.ts b/apps/backend/src/services/auth/auth.service.ts index 3b00bcd2..8dea316e 100644 --- a/apps/backend/src/services/auth/auth.service.ts +++ b/apps/backend/src/services/auth/auth.service.ts @@ -20,8 +20,8 @@ export class AuthService { private _notificationService: NotificationService, private _emailService: EmailService ) {} - async canRegister() { - if (!process.env.DISABLE_REGISTRATION) { + async canRegister(provider: string) { + if (!process.env.DISABLE_REGISTRATION || provider === Provider.GENERIC) { return true; } @@ -42,7 +42,7 @@ export class AuthService { throw new Error('User already exists'); } - if (!(await this.canRegister())) { + if (!(await this.canRegister(provider))) { throw new Error('Registration is disabled'); } @@ -144,7 +144,7 @@ export class AuthService { return user; } - if (!(await this.canRegister()) && provider !== Provider.GENERIC) { + if (!(await this.canRegister(provider))) { throw new Error('Registration is disabled'); }