docs: harden demo email migration checks
This commit is contained in:
@@ -27,6 +27,18 @@ const me = await req("/api/auth/demo-users"); check("demo-users >= 8", me.json.u
|
||||
const owner = await login("[email protected]"); check("owner login", !!owner.token && owner.user.role === "owner");
|
||||
const empLogin = await login("[email protected]"); check("employee login", empLogin.user.role === "employee" && empLogin.user.employee_id);
|
||||
const adminLogin = await login("[email protected]"); check("admin login", adminLogin.user.role === "admin");
|
||||
const legacyAdmin = await req("/api/auth/login", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ email: "[email protected]", password: "demo1234" }),
|
||||
});
|
||||
check("[email protected] legacy login rejected", legacyAdmin.status === 401, `status=${legacyAdmin.status}`);
|
||||
const legacyOwner = await req("/api/auth/login", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ email: "[email protected]", password: "demo1234" }),
|
||||
});
|
||||
check("[email protected] legacy login rejected", legacyOwner.status === 401, `status=${legacyOwner.status}`);
|
||||
const t = owner.token, eT = empLogin.token, aT = adminLogin.token;
|
||||
|
||||
// /me fix
|
||||
|
||||
Reference in New Issue
Block a user