Added login by Login or Email
This commit is contained in:
parent
60267cc315
commit
6a0a7a0bf2
2 changed files with 40 additions and 5 deletions
|
|
@ -51,7 +51,7 @@ class SessionController extends Controller
|
|||
} else {
|
||||
unset($_SESSION['login_token']);
|
||||
|
||||
$user = $this->userStore->getByEmail($this->getParam('email'));
|
||||
$user = $this->userStore->getByEmailOrName($this->getParam('email'));
|
||||
|
||||
if ($user && password_verify($this->getParam('password', ''), $user->getHash())) {
|
||||
session_regenerate_id(true);
|
||||
|
|
@ -69,7 +69,7 @@ class SessionController extends Controller
|
|||
$form->setMethod('POST');
|
||||
$form->setAction(APP_URL.'session/login');
|
||||
|
||||
$email = new b8\Form\Element\Email('email');
|
||||
$email = new b8\Form\Element\Text('email');
|
||||
$email->setLabel(Lang::get('email_address'));
|
||||
$email->setRequired(true);
|
||||
$email->setContainerClass('form-group');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue