diff --git a/apps/api/src/app/auth/auth.controller.ts b/apps/api/src/app/auth/auth.controller.ts index 715c284f4..1050fe5bf 100644 --- a/apps/api/src/app/auth/auth.controller.ts +++ b/apps/api/src/app/auth/auth.controller.ts @@ -7,6 +7,7 @@ import { Controller, Get, HttpException, + Param, Post, Req, Res, @@ -32,6 +33,26 @@ export class AuthController { private readonly webAuthService: WebAuthService ) {} + /** + * @deprecated + */ + @Get('anonymous/:accessToken') + public async accessTokenLoginGet( + @Param('accessToken') accessToken: string + ): Promise { + try { + const authToken = await this.authService.validateAnonymousLogin( + accessToken + ); + return { authToken }; + } catch { + throw new HttpException( + getReasonPhrase(StatusCodes.FORBIDDEN), + StatusCodes.FORBIDDEN + ); + } + } + @Post('anonymous') public async accessTokenLogin( @Body() body: { accessToken: string }