Open DanielRivers opened 2 days ago
[!IMPORTANT]
Review skipped
Auto reviews are disabled on base/target branches other than the default branch.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yaml
file in this repository. To trigger a single review, invoke the@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
This pull request introduces enhancements to token management within the application. Key changes include the addition of a validation step for access tokens in the setup
function, which now attempts to refresh tokens if validation fails. A new utility function refreshTokens
is also introduced to handle the token refresh logic. The getAccessToken
function is updated to incorporate this refresh mechanism, ensuring that valid tokens are retrieved or refreshed as necessary.
File | Change Summary |
---|---|
src/handlers/setup.ts | Added validation for access tokens; integrated refreshTokens logic; updated error handling for token issues. |
src/utils/getAccessToken.ts | Modified to include token refresh mechanism using kindeClient ; retains existing error handling and logging. |
src/utils/refreshTokens.ts | New file that defines refreshTokens function to refresh tokens and validate them; includes error logging. |
setup
function in src/handlers/setup.ts
, which is directly related to the main PR's changes in the same file, enhancing the retrieval of user claims from tokens.Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@coderabbitai review
Explain your changes
Alternative resolution to refresh token
Checklist
🛟 If you need help, consider asking for advice over in the Kinde community.