environment
This commit is contained in:
@@ -22,6 +22,7 @@ export class AuthController {
|
||||
@Body() authDto: AuthCodeDto,
|
||||
): Promise<User> {
|
||||
const user = await this.authService.registerOrLoginWithAuthCode(authDto);
|
||||
console.log(user)
|
||||
if (user == null) {
|
||||
throw new HttpException('forbidden', HttpStatus.FORBIDDEN);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,9 @@ export class AuthService {
|
||||
this.http.post(url, body).subscribe({
|
||||
next: async (response) => {
|
||||
const user = await this.saveExternalTokens(response.data as any);
|
||||
if (!user) {
|
||||
return resolve(null);
|
||||
}
|
||||
this.generateTokens(user);
|
||||
resolve(user);
|
||||
},
|
||||
@@ -55,7 +58,7 @@ export class AuthService {
|
||||
});
|
||||
}
|
||||
if (!user.isActive) {
|
||||
throw new HttpException('not active', HttpStatus.FORBIDDEN);
|
||||
return resolve(null);
|
||||
}
|
||||
|
||||
user.firstName = payload.firstName;
|
||||
|
||||
Reference in New Issue
Block a user