Add admin-assisted password reset
There's no email infrastructure in this app, so a self-service "forgot password" flow isn't feasible yet. Adds a "Reset Password" button per user in the admin panel instead: generates a random temporary password (shown once, for the admin to relay out-of-band), overwrites the user's password hash, and signs them out of every existing session so a stolen session can't outlive the reset. Verified live: old password rejected after reset, new temporary password logs in successfully. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f853d5e301
commit
9e57f8088a
5 files changed
+91
-5
No files matched your search
@@ -171,6 +171,11 @@ export async function adminDeleteUser(id) {
|
||||
return request('DELETE', `/admin/users/${id}`);
|
||||
}
|
||||
|
||||
/** Sets a random temporary password for a user and signs them out everywhere. Returns { temporaryPassword }. */
|
||||
export async function adminResetPassword(id) {
|
||||
return request('POST', `/admin/users/${id}/reset-password`);
|
||||
}
|
||||
|
||||
export async function adminListProjects() {
|
||||
return request('GET', '/admin/projects');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user