budibase/packages/auth/src/middleware/passport/jwt.js

12 lines
222 B
JavaScript
Raw Normal View History

2021-04-07 12:33:16 +02:00
exports.options = {
secretOrKey: process.env.JWT_SECRET,
}
exports.authenticate = async function(jwt, done) {
try {
return done(null, jwt)
} catch (err) {
return done(new Error("JWT invalid."), false)
}
}