Skip to content

Commit

Permalink
multiple URIs supported
Browse files Browse the repository at this point in the history
  • Loading branch information
data-henrik committed Jan 15, 2024
1 parent 3a7bd9f commit 964b221
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ app.use(configureOIDC);
// default protected route /authtest
app.get('/authtest', (req, res, next) => {
passport.authenticate('oidc', {
redirect_uri: `http://${req.headers.host}/redirect_uri`,
redirect_uri: req.secure ? 'https' : 'http'+`://${req.headers.host}/redirect_uri`,
})(req, res, next);
});

// callback for the OpenID Connect identity provider
// in the case of an error go back to authentication
app.get('/redirect_uri', (req, res, next) => {
passport.authenticate('oidc', {
redirect_uri: `http://${req.headers.host}/redirect_uri`,
redirect_uri: req.secure ? 'https' : 'http'+`://${req.headers.host}/redirect_uri`,
successRedirect: '/',
failureRedirect: '/authtest'
})(req, res, next);
Expand Down

0 comments on commit 964b221

Please sign in to comment.