Hi,
I'm trying to implement a 2 step log in (normal user/pass login and a 2FA login).
My route setup is something like this:
<Route path="/" component={App}>
<IndexRedirect to="VeryProtectedRoute"/>
<Route path="login" component={userIsNotAuthenticated(Login)}/>
<Route path="2FALogin" component={userIsAuthenticated(userIsNot2FAAuthenticated(2FALogin))}/>
<Route path="VeryProtectedRoute" component={userIsAuthenticated(userIs2FAAuthenticated(VeryProtectedComponent))}/>
</Route>
The process is like this:
- I try to go to /VeryProtectedRoute.
- I get redirected to /login?redirect=%2FVeryProtectedRoute.
- I login successfully.
- I get redirected to /VeryProtectedRoute.
- I get redirected to /2FALogin.
- I 2fa login successfully.
- I stay in /2FALogin and I am NOT redirected to /VeryProtectedRoute.
The problem is in step 5 - The URL i'm being redirected to lacks the "redirect" query param like in step 2. It should redirect me to "/2FALogin?redirect=%2FVeryProtectedRoute"....
Any clues on where to start look for a solution or the error in not adding the redirect?
Currently, we manually add the "redirect" query param but we'd like to have a general working code...
Thanks in advance!
Hi,
I'm trying to implement a 2 step log in (normal user/pass login and a 2FA login).
My route setup is something like this:
The process is like this:
The problem is in step 5 - The URL i'm being redirected to lacks the "redirect" query param like in step 2. It should redirect me to "/2FALogin?redirect=%2FVeryProtectedRoute"....
Any clues on where to start look for a solution or the error in not adding the redirect?
Currently, we manually add the "redirect" query param but we'd like to have a general working code...
Thanks in advance!