Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// // Customize @loopback/rest-explorer configuration here
this.bind(RestExplorerBindings.CONFIG).to({
path: '/explorer',
});
this.component(RestExplorerComponent);
// Add authentication component
this.component(AuthenticationComponent);
// Customize authentication verify handlers
this.bind(Strategies.Passport.OAUTH2_CLIENT_PASSWORD_VERIFIER).toProvider(
ClientPasswordVerifyProvider,
);
this.bind(Strategies.Passport.LOCAL_PASSWORD_VERIFIER).toProvider(
LocalPasswordVerifyProvider,
);
this.bind(Strategies.Passport.BEARER_TOKEN_VERIFIER).toProvider(
BearerTokenVerifyProvider,
);
this.bind(Strategies.Passport.RESOURCE_OWNER_PASSWORD_VERIFIER).toProvider(
ResourceOwnerVerifyProvider,
);
this.bind(Strategies.Passport.GOOGLE_OAUTH2_VERIFIER).toProvider(
GoogleOauth2VerifyProvider,
);
// Add authorization component
this.bind(AuthorizationBindings.CONFIG).to({
allowAlwaysPaths: ['/explorer'],
});
this.component(AuthorizationComponent);
this.projectRoot = __dirname;
// 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);
// Add authentication component
this.component(AuthenticationComponent);
// Customize authentication verify handlers
this.bind(Strategies.Passport.OAUTH2_CLIENT_PASSWORD_VERIFIER).toProvider(
ClientPasswordVerifyProvider,
);
this.bind(Strategies.Passport.LOCAL_PASSWORD_VERIFIER).toProvider(
LocalPasswordVerifyProvider,
);
this.bind(Strategies.Passport.BEARER_TOKEN_VERIFIER).toProvider(
BearerTokenVerifyProvider,
);
this.bind(Strategies.Passport.RESOURCE_OWNER_PASSWORD_VERIFIER).toProvider(
ResourceOwnerVerifyProvider,
);
this.bind(Strategies.Passport.GOOGLE_OAUTH2_VERIFIER).toProvider(
GoogleOauth2VerifyProvider,
);
// Add authorization component