File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -141,15 +141,15 @@ app.use(configureOIDC);
141141// default protected route /authtest
142142app . 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
150150app . 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 ) ;
You can’t perform that action at this time.
0 commit comments