Add first-login password setup flow

Accounts created by tenant/store onboarding (createtenantuser,
createtenantlocation) have no password set. Previously the login form
treated the backend's "please setup a password" response as a
successful login instead of prompting for one. Now auth.ts recognizes
it (PasswordSetupRequiredError) and LoginView routes to a create-
password step, then signs in immediately with the new password.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Suriya
2026-07-21 16:46:07 +05:30
parent f62668e54e
commit fef75a1cc2
4 changed files with 173 additions and 13 deletions

View File

@@ -1015,6 +1015,15 @@ export async function updateUser(input: UpdateUserInput): Promise<Row> {
return fiestaSend<Row>('users/update', 'PUT', input);
}
/**
* PUT /users/update — set (or reset) a user's login password. Same endpoint as
* `updateUser`, called with only userid + password so every other column is
* left untouched (the backend's Updates() skips zero-value fields).
*/
export async function setUserPassword(userid: number, password: string): Promise<Row> {
return fiestaSend<Row>('users/update', 'PUT', { userid, password });
}
export interface CreateTenantLocationPayload {
locationname: string;
email?: string;