You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a lot of SPAs so we are using a central "/login-redirect" callback path for all logins; as suggested by the Auth0 docs we are storing the actual return path in appState, and the callback reads the appState value and generates the proper redirect.
Our problem is that our SPAs run under subpaths, so the appState.target value isn't sufficient for a full redirect as it only stores the relative routing path within the SPA.
We addressed this by including the base path in the appState:
With this, we get the base path back but we've lost the target (routing) path, because the guard code overwrites the appState entirely if one is provided in redirectLoginOptions, see https://github.com/auth0/auth0-vue/blob/main/src/guard.ts#L20:
It would be helpful if this code merged the appState values here, so the resulting state has both the provided values and the calculated target value, ie.
Checklist
Describe the problem you'd like to have solved
We have a lot of SPAs so we are using a central "/login-redirect" callback path for all logins; as suggested by the Auth0 docs we are storing the actual return path in
appState
, and the callback reads the appState value and generates the proper redirect.Our problem is that our SPAs run under subpaths, so the
appState.target
value isn't sufficient for a full redirect as it only stores the relative routing path within the SPA.We addressed this by including the base path in the appState:
With this, we get the base path back but we've lost the target (routing) path, because the guard code overwrites the
appState
entirely if one is provided in redirectLoginOptions, see https://github.com/auth0/auth0-vue/blob/main/src/guard.ts#L20:It would be helpful if this code merged the
appState
values here, so the resulting state has both the provided values and the calculated target value, ie.Describe the ideal solution
If
RedirectLoginOptions.appState
is passed into the authGuard, the resulting appState includes both this and thetarget
path added by the authGuard.Alternatives and current workarounds
Our current workaround does the target mapping explicitly:
Additional context
No response
The text was updated successfully, but these errors were encountered: