apps/web: fix logout error
This commit is contained in:
parent
87e7bd1b4a
commit
9b35854864
@ -41,10 +41,10 @@ export class AuthController {
|
||||
|
||||
@Get('/logout')
|
||||
async logout(@Req() req: FastifyRequest, @Res() reply: FastifyReply) {
|
||||
this.clearCookies(req, reply);
|
||||
|
||||
const token = req.cookies[COOKIE_TOKEN_NAME];
|
||||
await this.authService.logout(token);
|
||||
if (token) await this.authService.logout(token);
|
||||
|
||||
this.clearCookies(req, reply);
|
||||
|
||||
return reply.status(302).redirect('/login');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user