File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,21 +13,21 @@ public function loginAction(Request $request)
1313 {
1414 $ session = $ request ->getSession ();
1515 $ authErrorKey = Security::AUTHENTICATION_ERROR ;
16+ $ error = null ;
1617
1718 if ($ request ->attributes ->has ($ authErrorKey )) {
1819 $ error = $ request ->attributes ->get ($ authErrorKey );
1920 } elseif (null !== $ session && $ session ->has ($ authErrorKey )) {
2021 $ error = $ session ->get ($ authErrorKey );
2122 $ session ->remove ($ authErrorKey );
22- } else {
23- $ error = null ;
2423 }
2524
26- if ($ error ) {
25+ if ($ error instanceof \Exception ) {
2726 throw new \RuntimeException ($ error ->getMessage ());
2827 }
2928
30- $ this ->get ('onelogin_auth ' )->login ($ session ->get ('_security.main.target_path ' ));
29+ $ firewallName = array_slice (explode ('. ' , trim ($ request ->attributes ->get ('_firewall_context ' ))), -1 )[0 ];
30+ $ this ->get ('onelogin_auth ' )->login ($ session ->get ('_security. ' .$ firewallName .'.target_path ' ));
3131 }
3232
3333 public function metadataAction ()
You can’t perform that action at this time.
0 commit comments