no
```
supertokens.init({
framework: "express",
supertokens: {
connectionURI: "http://localhost:3567",
},
appInfo: {
appName: "myapp",
apiDomain: "http://localhost:8000",
websiteDomain: "http://localhost:8080",
apiBasePath: "/auth",
websiteBasePath: "/"
},
recipeList: [
Passwordless.init({
flowType: "USER_INPUT_CODE",
contactMethod: "EMAIL_OR_PHONE"
}),
Session.init()
]
});
app.use(cors(
{
credentials: true,
origin: "http://localhost:8080",
allowedHeaders: ["content-type", ...supertokens.getAllCORSHeaders()],
}
))
app.use(ex.middleware());
app.use(ex.errorHandler())
app.use(expressContext())
const addHeaders = async (proxyReq, req, res) => {
if (req.context.userId === undefined) {
console.log("session undefined")
}else{
console.log("session defined")
proxyReq.setHeader("X-User-ID", req.context.userId);
}
}
app.use(async (req, res, next) => {
try {
let session = await Session.getSession(req, res);
if (session === undefined) {
throw Error("Should never come here")
}
let userId = session.getUserId();
req.context.userId = userId
console.log("userId", req.context.userId)
next();
} catch (err) {
next(err);
}
})
``