fix: show user logout reason message#8061
fix: show user logout reason message#8061jackkav merged 1 commit intoKong:developfrom ryan-willis:fix-logout-message-passing
Conversation
|
Timeout: I see no reason not to add the timeout option but we should take caution before modifying it in production as it can contribute to outage conditions. |
| const logoutMessage = window.localStorage.getItem('logoutMessage'); | ||
| useEffect(() => { | ||
| if (logoutMessage) { | ||
| window.localStorage.removeItem('logoutMessage'); | ||
| setMessage(logoutMessage); | ||
| } | ||
| }, [logoutMessage]); | ||
|
|
There was a problem hiding this comment.
we have a useLocalstorage.ts file containing this hook
There was a problem hiding this comment.
I just noticed its also deleting after reading, which make its it different to the hook.
The rationale was to imitate prior art: we persist contents to localStorage in the The other method I thought of was to pass parameters through the |
| origin, | ||
| headers, | ||
| onlyResolveOnSuccess = false, | ||
| timeout = INSOMNIA_FETCH_TIME_OUT, |
There was a problem hiding this comment.
not generally encouraged to use default args in this codebase, as we prefer fallbacks defined in the logic where we can co locate them with other fallbacks or logic. onlyResolveOnSuccess is an exception, I'll see if there is a way to avoid these
I noticed that there's a message attached to the app URI when a session expires:
Here's the result of the change:

I also included the ability to specify a custom timeout for fetch calls to the API; it's not in use right now but was helpful when debugging some connectivity issues