File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
apps/backend/src/services/auth Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments