User authentication race condition?
See original GitHub issueSo, I’m trying to setup a protected chain of routes. Right now the chain of routes is in a parent component that has an onEnter
function that checks for user existance:
<Route component={Me} onEnter={requireViewer} path="me">
It looks like this:
const requireViewer = (nextState, replace) => {
if (getState().users.viewer) return;
replace({
pathname: '/signin',
state: { nextPathname: nextState.location.pathname },
});
};
The problem is that the state seems to only have any info about the user about a second after the app finished rendering.
What’s the “este
” way to do this?
Issue Analytics
- State:
- Created 7 years ago
- Comments:24 (18 by maintainers)
Top Results From Across the Web
How we found and fixed a rare race condition in our session ...
This bug required very specific conditions: a background thread, shared exception context between the main thread and the background thread, ...
Read more >How to Prevent Race Conditions in Web Applications - Kroll
As per the OWASP testing guide, “A race condition is a flaw that produces an unexpected result when the timing of actions impact...
Read more >What is a Race Condition? - Veracode
Race condition attacks (also called Time of Check to Time of Use, or TOCTTOU attacks) take advantage of the need that computing systems...
Read more >Race Condition - HackTricks
Race conditions are vulnerabilities that appear in webs that limit the number of ... an application and authenticate users that the provider has...
Read more >What is a Race Condition? - TechTarget
A race condition is an undesirable situation that occurs when a device or system attempts to perform two or more operations at the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I, as usual, do not understand your comments.(take for what it is worth, I think your kung foo is good) Don’t know if this is a lang barrier or just “the way you want it”. No, general comments spinkled throughout the code base do not make for good design. Please clarify in a clear way that is clear and clarified.
Feel free to open new issue, but I really don’t have time for that.