Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@Returns(AuthDto)
@Validate()
async login(
@Validator() @BodyParams() body: LocalLoginDto,
@Request() req: any,
@Response() res,
@Next() next: NextFunction
) {
const auth = await this.authService.authenticateStrategy(AUTH_STRATEGY.LOCAL_STRATEGY, req, res, next);
res.json(auth);
}
@Post('/signup')
@Returns(AuthDto)
@Status(HTTPStatusCodes.CREATED)
@Validate()
async signup(
@Validator() @BodyParams() data: SignupDto
) {
const user = await this.authService.createUser(data);
const authData = await this.authService.authenticateLocal(user.email, data.password);
return authData;
}
/**
* This end point used for authentication with fb access_token provided
* Useful when the access_token is obtained via client-side sdk
*/
@Post('/facebook/token')
@Returns(AuthDto)