-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Suggestion
I have implement JWTStrategy
every thing working fine. now I am trying to further authenticate according to user roles
e.g if logged in user is not ADMIN raised HttpErrors.Forbidden error
current strategy-adapter.js code only raise InternalServerError if I pass error in cb() of JWTStrategy
I have changed strategy-adapter.js
reject(new rest_1.HttpErrors.InternalServerError(error)); to
reject(error); and pass
cb(new HttpErrors.Forbidden(), false); in auth-strategy.provides.ts
which working according to my requirement
my question is there best way to implement changes in my code instead of changing in @loopback/authentication module directly
Existing CODE
@loopback/authentication/strategy-adapter.js
strategy.error = function (error) {
reject(new rest_1.HttpErrors.InternalServerError(error));
};Reactions are currently unavailable