fix(auth): grant admin privileges to philipp.urbschat@gmail.com
This commit is contained in:
parent
2d42df53dd
commit
588e1c1cb4
2 changed files with 9 additions and 1 deletions
|
|
@ -11,7 +11,11 @@ class User {
|
||||||
$user = $this->db->single();
|
$user = $this->db->single();
|
||||||
if ($user && password_verify($password, $user['password'])) {
|
if ($user && password_verify($password, $user['password'])) {
|
||||||
$user['projects'] = json_decode($user['projects'], true) ?? [];
|
$user['projects'] = json_decode($user['projects'], true) ?? [];
|
||||||
|
if (in_array(strtolower($user['email']), ['philipp.urbschat@gmail.com', 'hi@philippurbschat.de'])) {
|
||||||
|
$user['is_admin'] = true;
|
||||||
|
} else {
|
||||||
$user['is_admin'] = (bool)$user['is_admin'];
|
$user['is_admin'] = (bool)$user['is_admin'];
|
||||||
|
}
|
||||||
return $user;
|
return $user;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -52,5 +52,9 @@ class MigrationService {
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci");
|
||||||
$db->execute();
|
$db->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure owner email addresses have admin privileges
|
||||||
|
$db->query("UPDATE home_users SET is_admin = 1, status = 'Active' WHERE LOWER(email) IN ('philipp.urbschat@gmail.com', 'hi@philippurbschat.de')");
|
||||||
|
$db->execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue