[fix] Misleading error when login
This commit is contained in:
parent
7feb3a6f5d
commit
30f755c0b2
@ -41,6 +41,7 @@ class SessionApplication{
|
|||||||
/**
|
/**
|
||||||
* @param $userName string
|
* @param $userName string
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
function getPassword($userName){
|
function getPassword($userName){
|
||||||
$this->asserts->isNotEmpty($userName, "The username can't be empty");
|
$this->asserts->isNotEmpty($userName, "The username can't be empty");
|
||||||
@ -51,7 +52,7 @@ class SessionApplication{
|
|||||||
$stmt->execute(array(':userName' => $userName));
|
$stmt->execute(array(':userName' => $userName));
|
||||||
$results = $stmt->fetchAll();
|
$results = $stmt->fetchAll();
|
||||||
if(!$results){
|
if(!$results){
|
||||||
exit($this->databaseSelectQueryErrorMessage);
|
throw new Exception('The user or password didnt match, please try again.');
|
||||||
}
|
}
|
||||||
$stmt = null;
|
$stmt = null;
|
||||||
return $results[0]['password'];
|
return $results[0]['password'];
|
||||||
|
Loading…
Reference in New Issue
Block a user