-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(oidc): Display spinner in OIDC login button during loading #1840
fix(oidc): Display spinner in OIDC login button during loading #1840
Conversation
Coverage Report
File Coverage
|
|
I think we could improve this a bit if we use the whoami request to set the loading state. It will be a little bit more work, but this will also make it a bit more generic which will help with some upcoming work to abstract our authentication. At the moment the
Then in the general slice we could use extraReducers to update the loading state using the whoami pending/rejected/fullfilled actions. |
I tried doing this, but the pending state is not lasting as long as we would like the loader/spinner to show. The button is still visible as the state quickly changes from pending to fulfilled. Investigating if there is something we can do. |
Ah OK, in that case we could dispatch additional events at the start/end of the whoami thunk to update the loading state. |
0732e04
to
74590de
Compare
I tried various combinations for the spots we could dispatch such events and the current arrangement makes sure there is no glitch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made some suggestions here for waiting until the user data has been retrieved.
There are two events happening, firstly the whoami check occurs to see if the user is authenticated, then the controller connection is created which is used to get the user details.
As you rightly realised we need to wait for both these events have happened otherwise it shows the login button again.
74590de
to
374bd58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works really well now! Just one small comment.
374bd58
to
de61bee
Compare
Done
QA
Details
https://warthogs.atlassian.net/browse/WD-18340
Screenshots