-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable seamless updates to user data and locale without full page rel…
…oads (#674) ### Summary & Motivation Introduce a more elegant solution for updating user data and UI language without requiring a full page reload. Previously, when a user's locale or profile data was updated via `/users/change-locale` or `/api/account-management/users`, the SPA triggered `/api/account-management/authentication/refresh-authentication-tokens` followed by a `window.location.reload()` to reflect changes in the UI. This approach was slow and cumbersome. With this update: - A new `AddRefreshAuthenticationTokens` extension sets an `x-refresh-authentication-tokens-required` HTTP header, instructing the AppGateway to refresh authentication tokens before serving the response. This ensures the updated JWT is included in the API response. - The `/refresh-authentication-tokens` endpoint has been moved to the `internal-api` namespace for enhanced security and proper scoping. - The browser now updates the UI language and user profile information dynamically, eliminating the need for a page reload. ### Changes - Added a new `ApiResult` extension to set an HTTP header for token refresh. - Updated the `/users/change-locale` and `/admin/user` endpoints to enforce authentication token updates, removing the need for SPA reloads. - Modified `/admin/user` to use the logged-in user's data instead of an `{id}` parameter, ensuring proper behavior for updating user information. - Updated the AvatarButton logic to prevent the `UserProfileModal` from opening twice. - Simplified `useActionState` usage in `InviteUserModal`. - Updated project guidelines with instructions to run builds and tests after making changes to the backend and frontend. ### Checklist - [x] I have added tests, or done manual regression tests - [x] I have updated the documentation, if necessary
- Loading branch information
Showing
14 changed files
with
194 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.