Skip to content

Commit

Permalink
🐛 Fix login response
Browse files Browse the repository at this point in the history
  • Loading branch information
Xen0Xys committed Jan 3, 2024
1 parent 3d961f9 commit 84614d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class AuthController{
// @ApiResponse({status: HttpStatus.FORBIDDEN, description: "Account not confirmed", type: CtResponse})
@ApiResponse({status: HttpStatus.NOT_FOUND, description: "Email not found"})
async login(@Query() params: KeepParamDto, @Body() loginDto: LoginDto): Promise<AtRtResponse | CtResponse>{
console.log(params);
return await this.authService.loginUser(loginDto.email, loginDto.password, params.keep);
}

Expand Down
4 changes: 3 additions & 1 deletion src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export class AuthService{
return new CtResponse(confirmationToken);
}
const accessToken = await this.tokensService.generateAccessToken(user.id);
if(keepLoggedIn){
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
if(keepLoggedIn === "true"){
const refreshToken = await this.tokensService.generateRefreshToken(user.id);
return new AtRtResponse(accessToken, refreshToken);
}
Expand Down

0 comments on commit 84614d2

Please sign in to comment.