mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-14 03:40:31 +00:00
refactor(nestjs): hook up auth endpoints
This commit is contained in:
23
packages/server/src/modules/Auth/Authed.controller.ts
Normal file
23
packages/server/src/modules/Auth/Authed.controller.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import { GetAuthenticatedAccount } from './queries/GetAuthedAccount.service';
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { IgnoreTenantSeededRoute } from '../Tenancy/EnsureTenantIsSeeded.guards';
|
||||
import { IgnoreTenantInitializedRoute } from '../Tenancy/EnsureTenantIsInitialized.guard';
|
||||
|
||||
@Controller('/auth')
|
||||
@ApiTags('Auth')
|
||||
@IgnoreTenantSeededRoute()
|
||||
@IgnoreTenantInitializedRoute()
|
||||
export class AuthedController {
|
||||
constructor(
|
||||
private readonly getAuthedAccountService: GetAuthenticatedAccount,
|
||||
) {}
|
||||
|
||||
@Get('/account')
|
||||
@ApiOperation({ summary: 'Retrieve the authenticated account' })
|
||||
async getAuthedAcccount() {
|
||||
const data = await this.getAuthedAccountService.getAccount();
|
||||
|
||||
return { data };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user