fix login error
This commit is contained in:
parent
abc1be3885
commit
20a26ebd66
6
User.php
6
User.php
@ -18,11 +18,13 @@ class User {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public function loginWithUsername(string $username, string $password) : string {
|
public function loginWithUsername(string $username, string $password) : string {
|
||||||
$userObject = $this->db->select("utente", ["nomeUtente" => $username])[0];
|
$query = $this->db->select("utente", ["nomeUtente" => $username]);
|
||||||
|
|
||||||
if(!$userObject){
|
if(!$query){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
$userObject = $query[0];
|
||||||
|
|
||||||
$this->id = $userObject["id"];
|
$this->id = $userObject["id"];
|
||||||
$this->username = $userObject["nomeUtente"];
|
$this->username = $userObject["nomeUtente"];
|
||||||
$this->email = $userObject["email"];
|
$this->email = $userObject["email"];
|
||||||
|
Loading…
Reference in New Issue
Block a user