Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
super(options);
// Set up the custom sequence
this.sequence(MySequence);
// Set up default home page
this.static('/', path.join(__dirname, '../public'));
// Customize @loopback/rest-explorer configuration here
this.bind(RestExplorerBindings.CONFIG).to({
path: '/explorer',
});
this.component(RestExplorerComponent);
// this.component(AuthenticationComponent);
this.bind(AuthenticationBindings.METADATA).toProvider(MyAuthMetadataProvider);
this.bind(MyAuthBindings.STRATEGY).toProvider(MyAuthAuthenticationStrategyProvider);
this.bind(AuthenticationBindings.AUTH_ACTION).toProvider(MyAuthActionProvider);
this.projectRoot = __dirname;
// Customize @loopback/boot Booter Conventions here
this.bootOptions = {
controllers: {
// Customize ControllerBooter Conventions here
dirs: ['controllers'],
extensions: ['.controller.js'],
nested: true,
},
};
}
constructor(
@inject(AuthenticationBindings.METADATA) private metadata: MyAuthenticationMetadata,
@repository(UserRepository) private userRepository: UserRepository,
@repository(UserRoleRepository) private userRoleRepository: UserRoleRepository,
) {}
constructor(
@inject(AuthenticationBindings.METADATA)
public metadata: AuthenticationMetadata,
@inject(MyAuthBindings.USER_PERMISSIONS)
protected checkPermissons: UserPermissionsFn,
@inject.getter(AuthenticationBindings.CURRENT_USER)
public getCurrentUser: Getter,
) {}
constructor(
@inject(AuthenticationBindings.METADATA)
private metadata: AuthenticationMetadata,
@inject(JWTAuthenticationBindings.STRATEGY)
private jwt_strategy: JWTStrategy,
) {}
value(): ValueOrPromise {
constructor(
@inject.getter(MyAuthBindings.STRATEGY) readonly getStrategy: Getter,
@inject.setter(AuthenticationBindings.CURRENT_USER) readonly setCurrentUser: Setter,
@inject.getter(AuthenticationBindings.METADATA) readonly getMetadata: Getter,
) {}
constructor(
@inject(AuthenticationBindings.METADATA)
public metadata: AuthenticationMetadata,
@inject(MyAuthBindings.USER_PERMISSIONS)
protected checkPermissons: UserPermissionsFn,
@inject(MyAuthBindings.TOKEN_SERVICE)
protected tokenService: TokenService,
) {}
async authenticate(request: Request): Promise {