@@ -313,7 +313,8 @@ app.get('/login',
313313 resourceURL : config . resourceURL , // optional. Provide a value if you want to specify the resource.
314314 customState : 'my_state' , // optional. Provide a value if you want to provide custom state value.
315315 failureRedirect : '/error' ,
316- domain_hint : config . branding . domainHint
316+ domain_hint : config . branding . domainHint ,
317+ prompt : 'select_account'
317318 }
318319 ) ( req , res , next ) ;
319320 } ,
@@ -326,22 +327,6 @@ app.get('/error', (req, res) => {
326327app . get ( '/unauthorized' , ( req , res ) => {
327328 return res . status ( 401 ) . render ( 'unauthorized.html' , { partials, productName : config . branding . title , logoPath : config . branding . logoPath , copyrightOwner : config . branding . copyrightOwner , statusURL : config . branding . statusURL , orgHome : config . branding . orgHome , groups : config . groups_permitted . toString ( ) . replaceAll ( "," , "<br />" ) , adminGroups : config . admin_groups . toString ( ) . replaceAll ( "," , "<br />" ) } ) ;
328329} ) ;
329- // 'GET returnURL'
330- // `passport.authenticate` will try to authenticate the content returned in
331- // query (such as authorization code). If authentication fails, user will be
332- // redirected to '/' (home page); otherwise, it passes to the next middleware.
333- app . get ( '/auth/openid/return' ,
334- function ( req , res , next ) {
335- passport . authenticate ( 'azuread-openidconnect' ,
336- {
337- response : res , // required
338- failureRedirect : '/'
339- }
340- ) ( req , res , next ) ;
341- } ,
342- function ( req , res ) {
343- res . redirect ( '/' ) ;
344- } ) ;
345330
346331// 'POST returnURL'
347332// `passport.authenticate` will try to authenticate the content returned in
@@ -351,8 +336,12 @@ app.post('/auth/openid/return',
351336 function ( req , res , next ) {
352337 passport . authenticate ( 'azuread-openidconnect' ,
353338 {
354- response : res , // required
355- failureRedirect : '/'
339+ response : res , // required
340+ resourceURL : config . resourceURL , // optional. Provide a value if you want to specify the resource.
341+ customState : 'my_state' , // optional. Provide a value if you want to provide custom state value.
342+ failureRedirect : '/error' ,
343+ domain_hint : config . branding . domainHint ,
344+ prompt : 'select_account'
356345 }
357346 ) ( req , res , next ) ;
358347 } ,
0 commit comments