mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 12:52:42 +01:00
Allow emails to be used for login
Summary: Despite the form's claims that you can login with username or email, it actually accepted only username. Test Plan: Logged in using my email. Reviewed By: jungejason Reviewers: tuomaspelkonen, jungejason, aran CC: jr, anjali, aran, jungejason Differential Revision: 354
This commit is contained in:
parent
fdf39a9cb1
commit
fff08a9894
1 changed files with 10 additions and 4 deletions
|
@ -44,11 +44,17 @@ class PhabricatorLoginController extends PhabricatorAuthController {
|
|||
$error = false;
|
||||
$username = $request->getCookie('phusr');
|
||||
if ($request->isFormPost()) {
|
||||
$username = $request->getStr('username');
|
||||
$username_or_email = $request->getStr('username_or_email');
|
||||
|
||||
$user = id(new PhabricatorUser())->loadOneWhere(
|
||||
'username = %s',
|
||||
$username);
|
||||
$username_or_email);
|
||||
|
||||
if (!$user) {
|
||||
$user = id(new PhabricatorUser())->loadOneWhere(
|
||||
'email = %s',
|
||||
$username_or_email);
|
||||
}
|
||||
|
||||
$okay = false;
|
||||
if ($user) {
|
||||
|
@ -91,8 +97,8 @@ class PhabricatorLoginController extends PhabricatorAuthController {
|
|||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setLabel('Username/Email')
|
||||
->setName('username')
|
||||
->setValue($username))
|
||||
->setName('username_or_email')
|
||||
->setValue($username_or_email))
|
||||
->appendChild(
|
||||
id(new AphrontFormPasswordControl())
|
||||
->setLabel('Password')
|
||||
|
|
Loading…
Reference in a new issue