mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-14 18:57:29 +02:00
Ensure the admin user always has full access to manage the application
Fixes admin role assignment, adds SQL scripts for manual correction, and provides debugging tools for production issues. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 4b008663-bd72-492b-b0b6-fa252367e730 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/4b008663-bd72-492b-b0b6-fa252367e730/nHdBv6m
This commit is contained in:
1 parent
a1ff814f6b
commit
87722d8132
6 files changed
+180
No files matched your search
@@ -0,0 +1,22 @@
|
||||
-- CORRECTION URGENTE ADMIN PRODUCTION
|
||||
-- Exécuter sur la base de production
|
||||
|
||||
-- 1. Vérifier l'utilisateur problématique (ID 3 d'après les logs)
|
||||
SELECT id, username, email, role, store_id FROM users WHERE id = 3;
|
||||
|
||||
-- 2. Corriger le rôle de l'utilisateur ID 3
|
||||
UPDATE users SET role = 'administrator' WHERE id = 3 AND username = 'admin';
|
||||
|
||||
-- 3. Vérifier si correction appliquée
|
||||
SELECT id, username, email, role, store_id FROM users WHERE id = 3;
|
||||
|
||||
-- 4. Nettoyer les sessions problématiques
|
||||
DELETE FROM sessions WHERE data LIKE '%"id":3%' AND data NOT LIKE '%"role":"administrator"%';
|
||||
|
||||
-- 5. Vérifier tous les utilisateurs admin
|
||||
SELECT id, username, email, role, store_id FROM users WHERE role = 'administrator';
|
||||
|
||||
-- 6. Forcer création admin backup si nécessaire
|
||||
INSERT INTO users (username, password, email, first_name, last_name, role, store_id, is_active, created_at, updated_at)
|
||||
VALUES ('admin_backup', '$2b$12$LQv3c1yqBwuvHi44M0Bfa.5jW.5J5J5J5J5J5J5J5J5J5J5J5J5J5J', 'admin_backup@regisflow.com', 'Admin', 'Backup', 'administrator', NULL, true, NOW(), NOW())
|
||||
ON CONFLICT (username) DO NOTHING;
|
||||
Reference in new issue
Block a user