mirror of
https://github.com/vernu/textbee.git
synced 2026-05-19 05:46:23 -04:00
feat(api): add an endpoint to check the current logged in user
This commit is contained in:
@@ -42,6 +42,19 @@ export class AuthController {
|
||||
return { data }
|
||||
}
|
||||
|
||||
@ApiOperation({ summary: 'Get current logged in user' })
|
||||
@ApiQuery({
|
||||
name: 'apiKey',
|
||||
required: false,
|
||||
description: 'Required if jwt bearer token not provided',
|
||||
})
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(AuthGuard)
|
||||
@Get('/who-am-i')
|
||||
async whoAmI(@Request() req) {
|
||||
return { data: req.user }
|
||||
}
|
||||
|
||||
@UseGuards(AuthGuard)
|
||||
@ApiOperation({ summary: 'Generate Api Key' })
|
||||
@ApiQuery({
|
||||
|
||||
@@ -35,7 +35,7 @@ export class RegisterDeviceInputDTO {
|
||||
appVersionCode?: number
|
||||
}
|
||||
|
||||
export class ISMSData {
|
||||
export class SMSData {
|
||||
@ApiProperty({
|
||||
type: String,
|
||||
required: true,
|
||||
@@ -51,4 +51,4 @@ export class ISMSData {
|
||||
})
|
||||
receivers: string[]
|
||||
}
|
||||
export class SendSMSInputDTO extends ISMSData {}
|
||||
export class SendSMSInputDTO extends SMSData {}
|
||||
|
||||
Reference in New Issue
Block a user