fix(embedded-sdk): handle malformed JWT refresh timing#40490
Open
LohitG wants to merge 1 commit into
Open
Conversation
Wrap guest token decoding in defensive error handling so malformed tokens use the default refresh timing instead of throwing before fallback logic runs. Add regression coverage for malformed, empty, and invalid-base64 token inputs.
Contributor
Code Review Agent Run #3b5890Actionable Suggestions - 0Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
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.
SUMMARY
getGuestTokenRefreshTimingcurrently decodes the guest token before applying its fallback timing logic. If the token string itself is malformed or undecodable,jwtDecodecan throw before the fallback path runs.This wraps the decode and expiration parsing logic in a
try/catch, so malformed guest tokens fall back to the existing default refresh timing instead of throwing.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A - no UI changes.
TESTING INSTRUCTIONS
Result:
ADDITIONAL INFORMATION