supertokens / supertokens-website

Frontend SDK for SuperTokens - for session management + automatically refreshing sessions
https://supertokens.com
Other
54 stars 13 forks source link

fix: session refresh loop in all request interceptors #258

Closed anku255 closed 5 months ago

anku255 commented 5 months ago

Summary of change

This PR fixes the session refresh loop in all the request interceptors that occurred when an API returned a 401 response despite a valid session. Interceptors now attempt to refresh the session a maximum of three times before returning the last API response. The retry limit is configurable via the maxRetryAttemptsForSessionRefresh option.

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

Documentation changes

(If relevant, please create a PR in our docs repo, or create a checklist here highlighting the necessary changes)

Checklist for important updates

github-actions[bot] commented 5 months ago

size-limit report 📦

Path Size
lib/build/bundleEntry.js 21.01 KB (+3.09% 🔺)