-
Notifications
You must be signed in to change notification settings - Fork 58
add max token renew limit #399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||
PR Type
Enhancement
Description
Add max token renewal limit to prevent infinite retry loops
Track token renewal count in user store and increment on each renewal
Clear retry queue and redirect to login when max renewals exceeded
Skip loader for token renewal endpoint requests
Improve token validation logic in request/response interceptors
Diagram Walkthrough
flowchart LR A["Token Expired"] --> B["Increment renew_token_count"] B --> C{"Count >= maxRenewTokenCount?"} C -->|Yes| D["Clear Queue & Redirect"] C -->|No| E["Refresh Token"] E --> F["Retry Requests"]File Walkthrough
http.js
Add token renewal limit and queue managementsrc/lib/helpers/http.js
maxRenewTokenCountproperty set to 30 to limit token renewalattempts
renew_token_countwhen token refresh is initiatedretries
token exists
/renew-tokenendpoint to skip loader regex patternsuserTypes.js
Add renew_token_count property to User typesrc/lib/helpers/types/userTypes.js
renew_token_countoptional property to User type definitionauth-service.js
Reset token renewal count on successful authsrc/lib/services/auth-service.js
renew_token_countto 0 when user successfully obtains a newtoken
store.js
Improve code formatting in getUserStoresrc/lib/helpers/store.js
getUserStore()functionretrieval