@@ -43,46 +43,46 @@ public function __construct(Guard $auth)
4343 public function handle (Request $ request , Closure $ next )
4444 {
4545 // If the user is already logged in, no need to reauthenticate
46- if ( ! $ this ->auth ->check () ) {
47-
46+ if (! $ this ->auth ->check ()) {
47+
4848 // Retrieve the SSO login attribute.
4949 $ auth = $ this ->getWindowsAuthAttribute ();
50-
50+
5151 // Retrieve the SSO input key.
5252 $ key = key ($ auth );
53-
53+
5454 // Handle Windows Authentication.
5555 if ($ account = $ request ->server ($ auth [$ key ])) {
5656 // Usernames may be prefixed with their domain,
5757 // we just need their account name.
5858 $ username = explode ('\\' , $ account );
59-
59+
6060 if (count ($ username ) === 2 ) {
6161 list ($ domain , $ username ) = $ username ;
6262 } else {
6363 $ username = $ username [key ($ username )];
6464 }
65-
65+
6666 // Create a new user LDAP user query.
6767 $ query = $ this ->newAdldapUserQuery ();
68-
68+
6969 // Filter the query by the username attribute
7070 $ query ->whereEquals ($ key , $ username );
71-
71+
7272 // Retrieve the first user result
7373 $ user = $ query ->first ();
74-
74+
7575 if ($ user instanceof User) {
7676 $ model = $ this ->getModelFromAdldap ($ user , str_random ());
77-
77+
7878 if ($ model instanceof Model && $ this ->auth ->guest ()) {
7979 // Double check user instance before logging them in.
8080 $ this ->auth ->login ($ model );
8181 }
8282 }
8383 }
8484 }
85-
85+
8686 return $ this ->returnNextRequest ($ request , $ next );
8787 }
8888
0 commit comments