mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 21:02:41 +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;
|
$error = false;
|
||||||
$username = $request->getCookie('phusr');
|
$username = $request->getCookie('phusr');
|
||||||
if ($request->isFormPost()) {
|
if ($request->isFormPost()) {
|
||||||
$username = $request->getStr('username');
|
$username_or_email = $request->getStr('username_or_email');
|
||||||
|
|
||||||
$user = id(new PhabricatorUser())->loadOneWhere(
|
$user = id(new PhabricatorUser())->loadOneWhere(
|
||||||
'username = %s',
|
'username = %s',
|
||||||
$username);
|
$username_or_email);
|
||||||
|
|
||||||
|
if (!$user) {
|
||||||
|
$user = id(new PhabricatorUser())->loadOneWhere(
|
||||||
|
'email = %s',
|
||||||
|
$username_or_email);
|
||||||
|
}
|
||||||
|
|
||||||
$okay = false;
|
$okay = false;
|
||||||
if ($user) {
|
if ($user) {
|
||||||
|
@ -91,8 +97,8 @@ class PhabricatorLoginController extends PhabricatorAuthController {
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTextControl())
|
id(new AphrontFormTextControl())
|
||||||
->setLabel('Username/Email')
|
->setLabel('Username/Email')
|
||||||
->setName('username')
|
->setName('username_or_email')
|
||||||
->setValue($username))
|
->setValue($username_or_email))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormPasswordControl())
|
id(new AphrontFormPasswordControl())
|
||||||
->setLabel('Password')
|
->setLabel('Password')
|
||||||
|
|
Loading…
Reference in a new issue