Fix/token error management#30
Merged
surafelfikru merged 4 commits intoMar 11, 2026
Merged
Conversation
|
@DagmawiKK is attempting to deploy a commit to the timverhaegen's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request improves the authentication flow and user experience on the tokens management page. It adds better handling for unauthorized API responses, ensures the root token input is updated reactively, and improves the logic for displaying token content. The most important changes are grouped by authentication handling, UI/UX improvements, and state management:
Authentication Handling:
requestfunction inapi.tsnow throws a specific "Unauthorized" error when a 401 or 403 response is received, making it easier to handle authentication failures downstream.tokens/lib.ts, when an "Unauthorized" error is caught during token fetching, the root token is cleared, removed from local storage, and a descriptive toast notification is shown to the user.UI/UX Improvements:
RootTokenForm.tsxis now controlled by a signal that updates whenever the initial token prop changes, ensuring the input stays in sync with the app state.State Management:
setRootTokenfunction is now imported and used intokens/lib.tsto clear the root token on authentication failure.These changes collectively improve error handling, user feedback, and the reliability of the token management workflow.
Type of Change
Checklist