mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
14 lines
347 B
JavaScript
14 lines
347 B
JavaScript
import { Strategy as JwtStrategy, ExtractJwt } from 'passport-jwt'
|
|
import config from '../config.js'
|
|
|
|
const jwtOptions = {
|
|
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
|
|
secretOrKey: config.jwtSecret,
|
|
}
|
|
|
|
function verifyJwt(jwtPayload, done) {
|
|
return done(null, jwtPayload)
|
|
}
|
|
|
|
export default new JwtStrategy(jwtOptions, verifyJwt)
|