synt_backend
Version:
Synt light-weight node backend service
26 lines (23 loc) • 716 B
JavaScript
var { expressjwt: jwt } = require("express-jwt");
module.exports = jsonWebToken;
function jsonWebToken() {
return jwt({
secret: process.env.JWT_SECRET,
algorithms: ["sha1", "RS256", "HS256"],
}).unless({
path: [
// public routes that don't require authentication
"/api/users/authenticate",
/\/api\/users\/token\/*/, //regex with wildcard
"/api/meetings/powerofattorney",
/\/api\/meetings\/*\/vote/,
/\/api\/meetings\/*\/presence/,
/\/api\/public\/*/,
"/health",
/\/api\/accounting\/*/, //TODO: Disable public routing
/\/api\/test\/*/, //TODO: Disable public routing
/\/api\/websocket\/*/,
/\/api\/webhooks\/*/,
],
});
}