- Admin server function (service-role) to create accounts, set role, and optionally link a parent to a student; wired via env_file (.env.secret) - Admin > Users: "Add a user" form (teacher/parent/admin) with one-time temp password - Student profile > Family: "Parent portal access" — create + link a parent login - Parents can now edit their own child's profile (RLS-scoped); internal notes stay admin-only Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
8 lines
344 B
TypeScript
8 lines
344 B
TypeScript
// Generate a readable temporary password (no ambiguous chars) for new accounts.
|
|
export function genTempPassword(len = 12): string {
|
|
const chars = "ABCDEFGHJKMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz23456789";
|
|
const arr = new Uint32Array(len);
|
|
crypto.getRandomValues(arr);
|
|
return Array.from(arr, (n) => chars[n % chars.length]).join("");
|
|
}
|