Feb 19, 2021
You're probably best doing that somewhere around the handleLogin function.
It would depend how your routes work, but react-router's navigation hooks should do the trick.
You could combine this with the context provider example in the Github Gist.