fix: user token error
This commit is contained in:
parent
b84c4fd8e3
commit
34aa9e10f9
6
User.php
6
User.php
@ -40,10 +40,12 @@ class User {
|
||||
return $this->token;
|
||||
}
|
||||
public function loginWithToken(string $token){
|
||||
$userObject = $this->db->select("utente", ["gettone" => $token])[0];
|
||||
if(!$userObject){
|
||||
$query = $this->db->select("utente", ["gettone" => $token]);
|
||||
if(!$query){
|
||||
return false;
|
||||
}
|
||||
$userObject = $query[0];
|
||||
|
||||
$this->id = $userObject["id"];
|
||||
$this->username = $userObject["nomeUtente"];
|
||||
$this->email = $userObject["email"];
|
||||
|
Loading…
Reference in New Issue
Block a user