File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010namespace OCA \User_SAML \AppInfo ;
1111
1212use OC \Security \CSRF \CsrfTokenManager ;
13+ use OC \User \DisabledUserException ;
1314use OC \User \LoginException ;
1415use OC_User ;
1516use OCA \DAV \Events \SabrePluginAddEvent ;
@@ -128,12 +129,14 @@ public function boot(IBootContext $context): void {
128129 if ($ request ->getPathInfo () === '/apps/user_saml/saml/error ' ) {
129130 return ;
130131 }
132+ /** @psalm-suppress UndefinedClass */
131133 $ targetUrl = $ urlGenerator ->linkToRouteAbsolute (
132134 'user_saml.SAML.genericError ' ,
133135 [
134- 'message ' => $ e-> getMessage ()
136+ 'reason ' => $ e instanceof DisabledUserException ? ' userDisabled ' : ' authFailed ' ,
135137 ]
136138 );
139+ $ logger ->error ('Login failure ' , ['exception ' => $ e ]);
137140 header ('Location: ' . $ targetUrl );
138141 exit ();
139142 }
@@ -151,7 +154,7 @@ public function boot(IBootContext $context): void {
151154 $ targetUrl = $ urlGenerator ->linkToRouteAbsolute (
152155 'user_saml.SAML.genericError ' ,
153156 [
154- 'message ' => $ l10n -> t ( ' This user account is disabled, please contact your administrator. ' )
157+ 'reason ' => ' userDisabled ' ,
155158 ]
156159 );
157160 header ('Location: ' . $ targetUrl );
You can’t perform that action at this time.
0 commit comments