Give local users their own manager: custom passwords and role reassignment

Move user management out of Settings into its own /users page (nav-gated
to owners), let an owner type a specific password on reset instead of
always generating a random one, and add role reassignment via a new
PUT /auth/users/{id}/role endpoint. Role changes revoke the target's
existing sessions, same as a password reset, so a demoted user can't
keep acting under a stale, higher-privileged session.
This commit is contained in:
2026-08-21 14:23:52 -07:00
parent 4b5dae5879
commit 864e68253a
10 changed files with 887 additions and 225 deletions
+8
View File
@@ -474,6 +474,14 @@ export function resetPassword(id: string, newPassword?: string): Promise<{ passw
});
}
export function setUserRole(id: string, role: string): Promise<LocalUser> {
return request(`/auth/users/${id}/role`, {
method: 'PUT',
credentials: 'include',
body: JSON.stringify({ role })
});
}
// --- alerting ---------------------------------------------------------
export type ConditionType = 'threshold' | 'absence';