UNPKG

lisa-box

Version:
40 lines 1.25 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); const JwtStrategy = require('passport-jwt').Strategy; const ExtractJwt = require('passport-jwt').ExtractJwt; const EXPIRES_IN_SECONDS = 60 * 60 * 24; const ALGORITHM = 'HS256'; const ISSUER = 'localhost'; const AUDIENCE = 'localhost'; const SECRET = process.env.TOKEN_SECRET || 'mysecuretoken'; exports.passport = { redirect: { login: '/', logout: '/' }, strategies: { local: { strategy: require('passport-local').Strategy, options: { usernameField: 'email' } }, jwt: { strategy: JwtStrategy, tokenOptions: { expiresInSeconds: EXPIRES_IN_SECONDS, secret: SECRET, algorithm: ALGORITHM, issuer: ISSUER, audience: AUDIENCE }, options: { secretOrKey: SECRET, issuer: ISSUER, audience: AUDIENCE, jwtFromRequest: ExtractJwt.fromExtractors([ExtractJwt.fromAuthHeader(), ExtractJwt.fromUrlQueryParameter('token')]) } }, } }; //# sourceMappingURL=passport.js.map