diff --git a/backend/src/modules/auth-module/controller/auth.controller.ts b/backend/src/modules/auth-module/controller/auth.controller.ts index ce2ebf4..5b0baa2 100644 --- a/backend/src/modules/auth-module/controller/auth.controller.ts +++ b/backend/src/modules/auth-module/controller/auth.controller.ts @@ -56,9 +56,9 @@ export class AuthController { }) @HttpCode(HttpStatus.OK) @UseGuards(SessionGuard) - @Post('logout') - public async logout(@Req() request: Request): Promise { - return this.authService.logout(request.sessionID); + @Post('signout') + public async signout(@Req() request: Request): Promise { + return this.authService.signout(request.sessionID); } @ApiCreatedResponse({ diff --git a/backend/src/modules/auth-module/services/auth.service.ts b/backend/src/modules/auth-module/services/auth.service.ts index 241a15d..442c740 100644 --- a/backend/src/modules/auth-module/services/auth.service.ts +++ b/backend/src/modules/auth-module/services/auth.service.ts @@ -110,6 +110,18 @@ export class AuthService { } } + public async signout(sessionId: string): Promise<{ success: boolean }> { + try { + this.sessionService.deleteSessionBySessionId(sessionId); + return { success: true }; + } catch (error) { + throw new HttpException( + 'Fehler beim Logout', + HttpStatus.INTERNAL_SERVER_ERROR + ); + } + } + public async checkAuthStatus( sessionId: string, userAgend: string @@ -145,16 +157,4 @@ export class AuthService { return responseData; } - - public async logout(sessionId: string): Promise<{ success: boolean }> { - try { - this.sessionService.deleteSessionBySessionId(sessionId); - return { success: true }; - } catch (error) { - throw new HttpException( - 'Fehler beim Logout', - HttpStatus.INTERNAL_SERVER_ERROR - ); - } - } }