MAPG-69 add active flag for users and check if user is active before login
This commit is contained in:
1 parent
28ed02091a
commit
66b21ec710
5 files changed
+42
-3
No files matched your search
@@ -53,6 +53,11 @@ class LoginController
|
||||
|
||||
$user = new User($userData);
|
||||
|
||||
if (!$user->getActive()) {
|
||||
$data = ['error' => 'user_not_active'];
|
||||
return new JsonContent($data);
|
||||
}
|
||||
|
||||
if (!$user->checkPassword($this->request->post('password'))) {
|
||||
$data = ['error' => 'password_not_match'];
|
||||
return new JsonContent($data);
|
||||
@@ -68,6 +73,6 @@ class LoginController
|
||||
{
|
||||
$this->request->session()->delete('user');
|
||||
|
||||
return new Redirect([\Container::$routeCollection->getRoute('login'), []], IRedirect::TEMPORARY);
|
||||
return new Redirect([\Container::$routeCollection->getRoute('index'), []], IRedirect::TEMPORARY);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user