Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.

Commit 167add8

Browse files
committed
close #3716
1 parent 95bf4a9 commit 167add8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/system/ZAuthModule/AuthenticationMethod/NativeEitherAuthenticationMethod.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,11 @@ public function getLoginTemplateName($type = 'page', $position = 'left')
6969
*/
7070
public function authenticate(array $data = [])
7171
{
72-
$field = filter_var($data['either'], FILTER_VALIDATE_EMAIL) ? 'email' : 'uname';
73-
$data[$field] = $data['either'];
72+
$field = 'email'; // default
73+
if (isset($data['either'])) {
74+
$field = filter_var($data['either'], FILTER_VALIDATE_EMAIL) ? 'email' : 'uname';
75+
$data[$field] = $data['either'];
76+
}
7477

7578
return $this->authenticateByField($data, $field);
7679
}

0 commit comments

Comments
 (0)