Browse Source

Deprecate GET auth endpoint

pull/1851/head
Thomas 2 years ago
parent
commit
a7a03e67f9
  1. 21
      apps/api/src/app/auth/auth.controller.ts

21
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<OAuthResponse> {
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 }

Loading…
Cancel
Save