diff --git a/src/auth/auth.controller.ts b/src/auth/auth.controller.ts index bb2132a..e419d23 100644 --- a/src/auth/auth.controller.ts +++ b/src/auth/auth.controller.ts @@ -37,7 +37,11 @@ export class AuthController { @Req() request: Request, @Res({ passthrough: true }) response: Response, ) { - return this.authService.logout(request.headers.cookie, response); + return this.authService.logout( + request.headers.cookie, + response, + this.getBearerToken(request), + ); } @Get('me') diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index d65b93c..6604372 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -63,10 +63,15 @@ export class AuthService { return this.frontendTokenResponse(authResponse); } - async logout(cookieHeader: string | undefined, response: Response) { + async logout( + cookieHeader: string | undefined, + response: Response, + accessToken?: string, + ) { await this.request('/auth/logout', { method: 'POST', cookieHeader, + accessToken, response, ignoreAuthErrors: true, });