feat: add logout functionality
This commit is contained in:
@@ -11,6 +11,7 @@ import { RequirePasswordDTO } from './dtos/responses/require-password.dto';
|
||||
import { TokensResponseDTO } from './dtos/responses/tokens.dto';
|
||||
import { LogoutDTO } from './dtos/logout.dto';
|
||||
import { ActiveUser } from '@/common/decorators/active-user.decorator';
|
||||
import { AccessToken } from './decorators/access-token.decorator';
|
||||
import { User } from '@/modules/users/entities/user.entity';
|
||||
|
||||
@Controller('auth')
|
||||
@@ -150,7 +151,11 @@ export class AuthController {
|
||||
],
|
||||
},
|
||||
])
|
||||
public async logout(@ActiveUser() user: User, @Body() logoutDto: LogoutDTO) {
|
||||
return await this.authService.logout(user.id, logoutDto);
|
||||
public async logout(
|
||||
@ActiveUser() user: User,
|
||||
@Body() logoutDto: LogoutDTO,
|
||||
@AccessToken() accessToken: string,
|
||||
) {
|
||||
return await this.authService.logout(user.id, logoutDto, accessToken);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user