@@ -313,7 +313,8 @@ app.get('/#',
313
313
resourceURL : config . resourceURL , // optional. Provide a value if you want to specify the resource.
314
314
customState : 'my_state' , // optional. Provide a value if you want to provide custom state value.
315
315
failureRedirect : '/error' ,
316
- domain_hint : config . branding . domainHint
316
+ domain_hint : config . branding . domainHint ,
317
+ prompt : 'select_account'
317
318
}
318
319
) ( req , res , next ) ;
319
320
} ,
@@ -326,22 +327,6 @@ app.get('/error', (req, res) => {
326
327
app . get ( '/unauthorized' , ( req , res ) => {
327
328
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 />" ) } ) ;
328
329
} ) ;
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
- } ) ;
345
330
346
331
// 'POST returnURL'
347
332
// `passport.authenticate` will try to authenticate the content returned in
@@ -351,8 +336,12 @@ app.post('/auth/openid/return',
351
336
function ( req , res , next ) {
352
337
passport . authenticate ( 'azuread-openidconnect' ,
353
338
{
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'
356
345
}
357
346
) ( req , res , next ) ;
358
347
} ,
0 commit comments