Skip to content

Commit 215398e

Browse files
committed
feat: oidc fix
1 parent 997034c commit 215398e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/backend/src/services/auth/auth.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export class AuthService {
2020
private _notificationService: NotificationService,
2121
private _emailService: EmailService
2222
) {}
23-
async canRegister() {
24-
if (!process.env.DISABLE_REGISTRATION) {
23+
async canRegister(provider: string) {
24+
if (!process.env.DISABLE_REGISTRATION || provider === Provider.GENERIC) {
2525
return true;
2626
}
2727

@@ -42,7 +42,7 @@ export class AuthService {
4242
throw new Error('User already exists');
4343
}
4444

45-
if (!(await this.canRegister())) {
45+
if (!(await this.canRegister(provider))) {
4646
throw new Error('Registration is disabled');
4747
}
4848

@@ -144,7 +144,7 @@ export class AuthService {
144144
return user;
145145
}
146146

147-
if (!(await this.canRegister()) && provider !== Provider.GENERIC) {
147+
if (!(await this.canRegister(provider))) {
148148
throw new Error('Registration is disabled');
149149
}
150150

0 commit comments

Comments
 (0)