refactor(server): auth route metadata (#9344)

This commit is contained in:
Jason Rasmussen
2024-05-09 13:58:44 -04:00
committed by GitHub
parent 34d8879d32
commit 8743e17528
33 changed files with 171 additions and 135 deletions

View File

@@ -8,23 +8,25 @@ import { UUIDParamDto } from 'src/validation';
@ApiTags('Sessions')
@Controller('sessions')
@Authenticated()
export class SessionController {
constructor(private service: SessionService) {}
@Get()
@Authenticated()
getSessions(@Auth() auth: AuthDto): Promise<SessionResponseDto[]> {
return this.service.getAll(auth);
}
@Delete()
@HttpCode(HttpStatus.NO_CONTENT)
@Authenticated()
deleteAllSessions(@Auth() auth: AuthDto): Promise<void> {
return this.service.deleteAll(auth);
}
@Delete(':id')
@HttpCode(HttpStatus.NO_CONTENT)
@Authenticated()
deleteSession(@Auth() auth: AuthDto, @Param() { id }: UUIDParamDto): Promise<void> {
return this.service.delete(auth, id);
}