fix(auth): grant admin privileges to philipp.urbschat@gmail.com

This commit is contained in:
Philipp Urbschat 2026-09-12 23:11:35 +02:00
parent 2d42df53dd
commit 588e1c1cb4
Signed by: Phili
SSH key fingerprint: SHA256:ZSQWnldzrYiABzOV6vTICPe0h19pTpus7sCbm2S0po0
2 changed files with 9 additions and 1 deletions

View file

@ -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) ?? [];
$user['is_admin'] = (bool)$user['is_admin']; 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'];
}
return $user; return $user;
} }
return false; return false;

View file

@ -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();
} }
} }