import Passage from "@passageidentity/passage-node";
appID: process.env.PASSAGE_APP_ID
// example of passage middleware
let passage = new psg(passageConfig);
let passageAuthMiddleware = (() => {
return async (req, res, next) => {
let userID = await passage.authenticateRequest(req);
// failed to authenticate
// we recommend returning a 401 or other "unauthorized" behavior
res.status(401).send('Could not authenticate user!');
app.get("/authenticatedRoute", passageAuthMiddleware, async(req, res) => {
// do authenticated things...