Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit 31c3c49

Browse files
committed
Account for no domain in server variable
- Thanks to @jspringe
1 parent 62bba48 commit 31c3c49

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Middleware/WindowsAuthenticate.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,15 @@ public function handle(Request $request, Closure $next)
5050

5151
// Handle Windows Authentication.
5252
if ($account = $request->server($auth[$key])) {
53-
// Usernames will be prefixed with their domain,
53+
// Usernames may be prefixed with their domain,
5454
// we just need their account name.
55-
list($domain, $username) = explode('\\', $account);
55+
$username = explode('\\', $account);
56+
57+
if (count($username) === 2) {
58+
list($domain, $username) = explode('\\', $account);
59+
} else {
60+
$username = $username[key($username)];
61+
}
5662

5763
// Create a new user LDAP user query.
5864
$query = $this->newAdldapUserQuery();

0 commit comments

Comments
 (0)