EdwinN1337
01/12/2024, 1:00 PMjs
Session.init({
cookieDomain: process.env.NODE_ENV === 'production' ? '.lokalist.nl' : 'localhost',
cookieSameSite: process.env.NODE_ENV === 'development' ? 'strict' : 'none',
});
And this is our frontend configuration:
js
Session.init({
sessionTokenBackendDomain: process.env.NODE_ENV === 'production' ? '.lokalist.nl' : 'localhost',
});
In our Express app, we want to leverage these session cookies. Below is the middleware function we use for session authentication:
js
const sessionAuthentication = (req: Request, res: Response, next) => {
try {
verifySession({
sessionRequired: true,
})(req, res, next);
} catch (e) {
console.log(e);
throw new StandardError('UNAUTHORIZED', 'Unauthorized', e, {});
}
};
I previously consulted with SuperTokens support, and they mentioned we were using header-based authentication. However, this is only the case for our mobile apps, not for the web application in question.
Could you advise on how to properly use the cookies set by dashboard.domain.nl for authorizing requests on server.lokalist.nl?