diff options
author | James E. Blair <jim@acmegating.com> | 2022-09-27 10:42:08 -0700 |
---|---|---|
committer | James E. Blair <jim@acmegating.com> | 2022-10-25 20:19:40 -0700 |
commit | 25c948d2a0079892d29f5aeb5f4bd398128ea7ce (patch) | |
tree | 3e523621a0e4e1df183709e39e8fdcfe76dd29ee /web/src/reducers | |
parent | 8c47d9ce4e97ff624a93fb1caa6de1d9c0bdccba (diff) | |
download | zuul-25c948d2a0079892d29f5aeb5f4bd398128ea7ce.tar.gz |
Linger on auth_callback page until login is complete
Verifying the auth token and obtaining user metadata involves some
async HTTP requests in the background. If we remove the auth callback
information from the window location too soon, then the UserManager
will not complete the login process. This currently generally works
because this process tends to complete before the /info and /tenant/info
calls to Zuul. However, future changes to support a read-only
authentication requirement will need to alter this sequence.
This approach is more robust and easier to follow. Essentially the
sequence is:
* Return from IdP to /auth_callback
* If /auth_callback is in our location, short-circuit normal rendering
and render only the AuthCallbackPage
* When background processing is complete, onSignIn will be called and
we will set the user.redirect property in redux.
* AuthCallbackPage has an effect callback on user.redirect which will
cause it to perform the redirect away from auth_callback once
signin is complete.
This process leaves the AuthCallbackPage on the screen a little longer,
so this change updates it to use the newer EmptyPage and Spinner elements
that we have been using elsewhere, so if users see it, it appears more
intentional.
Change-Id: I206c020626c7fd73e58efc29dd50376203679721
Diffstat (limited to 'web/src/reducers')
-rw-r--r-- | web/src/reducers/user.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/web/src/reducers/user.js b/web/src/reducers/user.js index 1a36fdae1..215cbfb1a 100644 --- a/web/src/reducers/user.js +++ b/web/src/reducers/user.js @@ -29,6 +29,7 @@ export default (state = { scope: [], isAdmin: false, tenant: null, + redirect: null, }, action) => { switch (action.type) { case USER_LOGGED_IN: { @@ -36,6 +37,7 @@ export default (state = { isFetching: false, data: action.user, token: action.token, + redirect: action.redirect, scope: [], isAdmin: false } @@ -45,6 +47,7 @@ export default (state = { isFetching: false, data: null, token: null, + redirect: null, scope: [], isAdmin: false } |