|
|
@@ -24,11 +24,11 @@ class UserModel
|
|
|
*/
|
|
|
public function validateLogin(string $username, string $password): ?array
|
|
|
{
|
|
|
- $stmt = $this->pdo->prepare("SELECT user_id, user_name, password FROM user WHERE user_name = :username AND user_flag = 'a'");
|
|
|
+ $stmt = $this->pdo->prepare("SELECT user_id, user_name, user_password FROM user WHERE user_name = :username AND user_flag = 'a'");
|
|
|
$stmt->execute(['username' => $username]);
|
|
|
$user = $stmt->fetch(\PDO::FETCH_ASSOC);
|
|
|
|
|
|
- if ($user && password_verify($password, $user['password'])) {
|
|
|
+ if ($user && password_verify($password, $user['user_password'])) {
|
|
|
unset($user['password']); // Remove hash por segurança
|
|
|
return $user;
|
|
|
}
|