@@ -360,7 +360,8 @@ local function openidc_authorization_response(opts, session)
360360 session :save ()
361361
362362 -- redirect to the URL that was accessed originally
363- return ngx .redirect (session .data .original_url ), session
363+ ngx .redirect (session .data .original_url )
364+ return nil , nil , session .data .original_url , session
364365
365366end
366367
@@ -636,12 +637,13 @@ function openidc.authenticate(opts, target_url, unauth_action, session_opts)
636637 ngx .log (ngx .ERR , err )
637638 return nil , err , target_url , session
638639 end
639- return openidc_authorization_response (opts , session ), session
640+ return openidc_authorization_response (opts , session )
640641 end
641642
642643 -- see if this is a request to logout
643644 if path == (opts .logout_path and opts .logout_path or " /logout" ) then
644- return openidc_logout (opts , session ), session
645+ openidc_logout (opts , session )
646+ return nil , nil , target_url , session
645647 end
646648
647649 -- if we have no id_token then redirect to the OP for authentication
@@ -653,14 +655,16 @@ function openidc.authenticate(opts, target_url, unauth_action, session_opts)
653655 target_url ,
654656 session
655657 end
656- return openidc_authorize (opts , session , target_url ), session
658+ openidc_authorize (opts , session , target_url )
659+ return nil , nil , target_url , session
657660 end
658661
659662 -- silently reauthenticate if necessary (mainly used for session refresh/getting updated id_token data)
660663 if opts .refresh_session_interval ~= nil then
661664 if session .data .last_authenticated == nil or (session .data .last_authenticated + opts .refresh_session_interval ) < ngx .time () then
662665 opts .prompt = " none"
663- return openidc_authorize (opts , session , target_url ), session
666+ openidc_authorize (opts , session , target_url )
667+ return nil , nil , target_url , session
664668 end
665669 end
666670
0 commit comments