Yes, you need to configure the SDK as follows:
- set the
authorizationParams.redirect_urito a unprotected route, e.g.window.location.origin + '/callback' - ensure the router has a route configured for
callbackthat does not require authentication - call loginWithRedirect and configure
appState.targetto be/, this ensures our SDK redirects back to the home page after the user was authenticated succesful.
The important part is, as mentioned, to redirect back to an unprotected route that does not call loginWithRedirect.
On top of that, you should not call loginWithRedirect when the user is already authenticated.
Even better would be to use our AuthGuard to protect the home URL, but you still need the /callback redirect_uri part.