quick safe

This commit is contained in:
Johannes Kantz
2023-01-12 15:22:32 +01:00
parent a2178733da
commit a887921e5d
2 changed files with 15 additions and 3 deletions

View File

@@ -38,6 +38,16 @@ class User {
return $this->token;
}
public function loginWithToken(string $token){
$userObject = $this->db->select("utente", ["gettone" => $token]);
if(!$userObject){
return false;
}
$this->id = $userObject["id"];
$this->username = $userObject["nomeUtente"];
$this->email = $userObject["email"];
$this->password = $userObject["parolaDordine"];
$this->token = $token;
return $this;
}
}