Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
app.configure(local());
// !code: loc_1 // !end
app.configure(oauth2(Object.assign({
name: 'auth0',
Strategy: Auth0Strategy,
// !code: auth0_options // !end
}, config.auth0)));
app.configure(oauth2(Object.assign({
name: 'google',
Strategy: GoogleStrategy,
// !code: google_options // !end
}, config.google)));
app.configure(oauth2(Object.assign({
name: 'facebook',
Strategy: FacebookStrategy,
// !code: facebook_options // !end
}, config.facebook)));
app.configure(oauth2(Object.assign({
name: 'github',
Strategy: GithubStrategy,
// !code: github_options // !end
}, config.github)));
// !code: loc_2 // !end
// The `authentication` service is used to create a JWT.
// The before `create` hook registers strategies that can be used
// to create a new valid JWT (e.g. local or oauth2)
app.configure(oauth2(Object.assign({
name: 'auth0',
Strategy: Auth0Strategy
}, config.auth0)));
app.configure(oauth2(Object.assign({
name: 'google',
Strategy: GoogleStrategy
}, config.google)));
app.configure(oauth2(Object.assign({
name: 'facebook',
Strategy: FacebookStrategy
}, config.facebook)));
app.configure(oauth2(Object.assign({
name: 'github',
Strategy: GithubStrategy
}, config.github)));
// !code: loc_2 // !end
// The `authentication` service is used to create a JWT.
// The before `create` hook registers strategies that can be used
// to create a new valid JWT (e.g. local or oauth2)
app.service('authentication').hooks({
before: {
create: [
authentication.hooks.authenticate(config.strategies),
],
remove: [
authentication.hooks.authenticate('jwt'),
import feathers, { Application } from '@feathersjs/feathers';
import feathersAuthenticationOAuth2, { Verifier, FeathersAuthenticationOAuth2Options } from '@feathersjs/authentication-oauth2';
import { RequestHandler, Response, NextFunction } from 'express';
import { Request } from 'express-serve-static-core';
import { Strategy } from 'passport';
import { Profile as GithubProfile } from 'passport-github';
import { Profile as FacebookProfile } from 'passport-facebook';
const app: Application = feathers().configure(feathersAuthenticationOAuth2());
class CustomVerifier extends Verifier {
constructor(app: Application, options: any = {}) {
super(app, options);
}
}
const handler: RequestHandler = (req: Request, res: Response, next: NextFunction) => { };
class someStrategy extends Strategy {
something = "foo";
}
/**
* Strongly Typed Verifier
*/