In @okta/oidc-middleware, callback redirection is not working as expected.
Its never reaching afterCallback url since the callback handler method is entering infinite loop. Can someone help me with the issue?
const oidc = new ExpressOIDC({
appBaseUrl: config.server.baseUrl,
issuer: oktaAuthConfig.issuer,
client_id: oktaAuthConfig.clientId,
client_secret: oktaAuthConfig.clientSecret,
scope: 'openid profile',
routes: {
login: {
path: '/signup',
},
loginCallback: {
path: '/oktaAuth/callback',
handler: async (req, _res, next) => {
console.log('req.session', req.session);
req.session.save();
next();
},
afterCallback: '/oktaAuth/callback/provider',
},
logout: {
path: '/logout',
},
logoutCallback: {
path: '/signup',
}
}
});