mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-23 07:26:30 +00:00
cc79f561e5
JwtAuthGuard, OptionalJwtAuthGuard, CookieAuthGuard, AdminGuard, the global and MFA guards, @CurrentUser, @Public, JWT verification and the ephemeral token service lived in the auth domain, so every controller that checked a session depended on the whole account module and its imports. They import no domain themselves; under src/nest/auth-core they are shared kernel like common/, every importer points there directly, and AtlasModule and NotificationsModule stop importing AuthModule, which they only did for the demo gate. lint:boundaries counts auth-core as kernel: 57 fewer cyclic domain edges, the largest cycle shrinks from 46 to 40 domains.
23 lines
756 B
TypeScript
23 lines
756 B
TypeScript
import { Controller, Get, UseGuards } from '@nestjs/common';
|
|
import { AddonsService } from './addons.service';
|
|
import { JwtAuthGuard } from '../auth-core/jwt-auth.guard';
|
|
|
|
/**
|
|
* GET /api/addons — the enabled trip add-ons + photo providers feed.
|
|
* Byte-identical to the legacy inline handler in server/src/app.ts
|
|
* (authenticate-gated, returns { collabFeatures, addons: [...] }).
|
|
*
|
|
* Distinct from the addon sub-mounts /api/addons/atlas and /api/addons/vacay
|
|
* (their own Nest modules); the strangler routes only the EXACT /api/addons here.
|
|
*/
|
|
@Controller('api/addons')
|
|
@UseGuards(JwtAuthGuard)
|
|
export class AddonsController {
|
|
constructor(private readonly addons: AddonsService) {}
|
|
|
|
@Get()
|
|
async list() {
|
|
return this.addons.list();
|
|
}
|
|
}
|