|
@ -7,6 +7,7 @@ import { |
|
|
Controller, |
|
|
Controller, |
|
|
Get, |
|
|
Get, |
|
|
HttpException, |
|
|
HttpException, |
|
|
|
|
|
Param, |
|
|
Post, |
|
|
Post, |
|
|
Req, |
|
|
Req, |
|
|
Res, |
|
|
Res, |
|
@ -32,6 +33,26 @@ export class AuthController { |
|
|
private readonly webAuthService: WebAuthService |
|
|
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') |
|
|
@Post('anonymous') |
|
|
public async accessTokenLogin( |
|
|
public async accessTokenLogin( |
|
|
@Body() body: { accessToken: string } |
|
|
@Body() body: { accessToken: string } |
|
|