Problem
I follow the production deployment,deploy on cloudflare, add admin secret
echo "[email protected]" | wrangler secret put ADMIN_EMAIL --env production
echo "your-secure-password" | wrangler secret put ADMIN_PASSWORD --env production
openssl rand -base64 32 | wrangler secret put JWT_SECRET --env production
openssl rand -base64 32 | wrangler secret put BETTER_AUTH_SECRET --env production
But when i try to login, it reports Invalid email or password.
Goal
Login as admin in production.
Effort
I check remote auth_user, auth_account tables,no entries found. Then i use the sql from seed-admin.ts
INSERT INTO auth_user (id, email, first_name, last_name, role, is_active, created_at, updated_at, name) VALUES(xxx)
INSERT INTO auth_account (id, user_id, account_id, provider_id, password, created_at, updated_at) VALUES(xxx)
Now it reports You do not have permission to access this area. I think it's because the missing of rbac record. But seed-admin.ts use rbac service to add user role. I don't know how to deal with it in sql.
const rbac = new RbacService(env.DB)
await rbac.ensureSystemRbacSeed()
await rbac.addUserRoleByName(odid, 'admin')
Problem
I follow the production deployment,deploy on cloudflare, add admin secret
But when i try to login, it reports
Invalid email or password.Goal
Login as admin in production.
Effort
I check remote
auth_user,auth_accounttables,no entries found. Then i use the sql from seed-admin.tsNow it reports
You do not have permission to access this area. I think it's because the missing of rbac record. But seed-admin.ts use rbac service to add user role. I don't know how to deal with it in sql.