-
Notifications
You must be signed in to change notification settings - Fork 0
feat: enforce mustChangePassword redirect in router guards #346
Copy link
Copy link
Closed
Labels
scope:large3+ days of work3+ days of worktype:featureNew feature implementationNew feature implementation
Description
Summary
When the backend sets mustChangePassword: true on a user profile, the web dashboard should enforce a redirect to a /change-password route, preventing navigation to any other page until the password is changed. Currently, mustChangePassword is only surfaced as a toast notification in LoginPage.vue — there is no route-level enforcement.
Context
This was identified during PR #344 review (round 2 external feedback). A TODO comment has been added in web/src/router/guards.ts:
// TODO(#mustChangePassword): Enforce mustChangePassword redirect when
// /change-password route and page are added in the page-views PR.
// Currently only surfaced as a toast in LoginPage.vue.Requirements
Must have
- Add
/change-passwordroute — new page-level component (web/src/views/ChangePasswordPage.vue) with current/new/confirm password fields - Router guard enforcement — in
web/src/router/guards.ts, ifauth.user?.mustChangePasswordis true, redirect to/change-passwordon every navigation (except/change-passworditself and/logout) - Password change API call — add endpoint wrapper in
web/src/api/endpoints/auth.tsto call the backend's change-password endpoint - On success — clear the
mustChangePasswordflag on the local user profile and redirect to the originally intended route
Should have
- Budget store fetch param tracking — the
lastFetchParamstracking added in PR feat: web dashboard core infrastructure (PR 1 of 2) #344 toweb/src/stores/budget.tsshould be validated end-to-end with the/change-passwordflow (ensure budget WS events still respect active filters after re-auth) - Approvals store active query tracking — the
activeFiltersref added in PR feat: web dashboard core infrastructure (PR 1 of 2) #344 toweb/src/stores/approvals.tsshould be validated end-to-end similarly (ensure approval WS events only insert into unfiltered views after re-auth)
Nice to have
- Password strength indicator — visual feedback on new password strength
- Session invalidation — optionally invalidate other sessions after password change
Blocked by
This requires the page-views PR (PR 2) to land first, since /change-password is a new view/route.
Related
- PR feat: web dashboard core infrastructure (PR 1 of 2) #344 — where the TODO was added
web/src/router/guards.ts— location of the TODO commentweb/src/views/LoginPage.vue— current toast-only handlingweb/src/views/SetupPage.vue— same toast-only handling
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
scope:large3+ days of work3+ days of worktype:featureNew feature implementationNew feature implementation