Skip to content

Commit 964b221

Browse files
committed
multiple URIs supported
1 parent 3a7bd9f commit 964b221

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,15 @@ app.use(configureOIDC);
141141
// default protected route /authtest
142142
app.get('/authtest', (req, res, next) => {
143143
passport.authenticate('oidc', {
144-
redirect_uri: `http://${req.headers.host}/redirect_uri`,
144+
redirect_uri: req.secure ? 'https' : 'http'+`://${req.headers.host}/redirect_uri`,
145145
})(req, res, next);
146146
});
147147

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

0 commit comments

Comments
 (0)