- Wrap entire beforeEach guard in try/catch to prevent crashes from
breaking navigation and leaving a blank page
- Add missing next() at end of try block so all code paths resolve
- Integrate switchDepartment() after loadMyDepartments() when exactly
1 department is available, enabling transparent single-dept flow
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add Department type to types.ts
- Add loadMyDepartments / switchDepartment to store/org.ts
- Auto-load departments after org switch in main.ts
- Single-department orgs auto-select default department
- localStorage persistence for CurrentDepartmentId
Parse current_org_id/current_org_role_keys from subject payload when tokens are encoded under claims.sub, so org switch context is correctly detected.
Made-with: Cursor
Add base64 padding before atob when parsing token payload so current_org_id extraction no longer fails intermittently and loops users back to org select.
Made-with: Cursor
After org switch, set HtySudoerToken to the refreshed Authorization token so ws endpoints receive current_org_id instead of a sudo2 token without org context.
Made-with: Cursor
Regenerate HtySudoerToken after switching organization so ws endpoints that read org context from sudo token no longer fail with current_org_id required.
Made-with: Cursor
Ensure authenticated users without current_org_id are redirected or auto-switched before entering business routes, preventing global 500 errors after multi-organization rollout.
Made-with: Cursor
- Sanitize page_path before router.push (H5) to prevent cross-user login via shared link
- onShareAppMessage: remove unionid/openid/status and related query keys from shared path
- main.ts: fix login(to.query.toString()) bug; when already logged in, strip foreign unionid from URL instead of logout
Made-with: Cursor
Add the current frontend codebase with a baseline .gitignore and update piano-specific UI terms to teaching-oriented terms for the current product context.
Made-with: Cursor