Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
expiresIn: this.client.authCodeExpiration,
audience: req.client_id,
subject: req.username,
issuer: process.env.JWT_ISSUER,
});
return {
code: token,
};
} catch (error) {
throw new HttpErrors.InternalServerError(
AuthErrorKeys.InvalidCredentials,
);
}
}
@authenticateClient(STRATEGY.CLIENT_PASSWORD)
@authenticate(STRATEGY.OAUTH2_RESOURCE_OWNER_GRANT)
@authorize(['*'])
@post('/auth/login-token', {
responses: {
[STATUS_CODE.OK]: {
description: 'Token Response Model',
content: {
[CONTENT_TYPE.JSON]: {
schema: {'x-ts-type': TokenResponse},
},
},
},
},
})
async loginWithClientUser(
@requestBody() req: LoginRequest,