diff --git a/api/src/auth/auth.controller.ts b/api/src/auth/auth.controller.ts index 0f21a41..1803ed7 100644 --- a/api/src/auth/auth.controller.ts +++ b/api/src/auth/auth.controller.ts @@ -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({ diff --git a/api/src/gateway/gateway.dto.ts b/api/src/gateway/gateway.dto.ts index 4881f81..07baf66 100644 --- a/api/src/gateway/gateway.dto.ts +++ b/api/src/gateway/gateway.dto.ts @@ -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 {}