refactor(nestjs): hook up auth endpoints

This commit is contained in:
Ahmed Bouhuolia
2025-05-08 18:10:02 +02:00
parent 401b3dc111
commit f78d6efe27
26 changed files with 304 additions and 111 deletions

View 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 };
}
}