I’m following the okta node guide, and everything works perfectly. So seamless in fact, that I’m getting nervous that there has to be something I’m missing and the whole thing is going to fall over in production
I’m building a svelte-kit app and using adapter-node. Everything is working great, just one thing…
Right now, when a user tries to go to some page on my site, they get shuttled along to the login page and then dumped onto the homepage.
app.use(
'/authorization-code/callback',
passport.authenticate('oidc', { failureRedirect: '/error' }),
(req, res) => {
// Don't do this. It is bad UX.
//res.redirect('/');
// Instead, send the user back to wherever they were trying to go...
res.redirect(pageUserWasGoingToThatTriggeredAuthFlow);
}
);
Any idea how I can do this?