Skip to content
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

Improve pollForExpiredAuth and reauthenticate UX #141

Merged
merged 14 commits into from
May 17, 2023

Conversation

jeffdaley
Copy link
Contributor

@jeffdaley jeffdaley commented Apr 14, 2023

Improves pollForExpiredAuth handling as well as the reauthentication UX:

  • We now refresh userInfo as part of the re-auth flow
  • We now show success and error messages on re-auth
  • We now check for stale reauthMessages during polling. Now, e.g., if someone reauthenticates on another tab, the other tabs should update within 10 seconds.

Plus some tests and cleanup.

@jeffdaley jeffdaley changed the title Jeffdaley/fix poll errors Improve /me polling and reauthenticate UX Apr 14, 2023
@jeffdaley jeffdaley changed the title Improve /me polling and reauthenticate UX Improve pollForExpiredAuth and reauthenticate UX Apr 14, 2023
@jeffdaley jeffdaley marked this pull request as ready for review April 20, 2023 21:31
@jeffdaley jeffdaley requested a review from a team as a code owner April 20, 2023 21:31
@jeffdaley jeffdaley marked this pull request as draft April 28, 2023 13:45
@jeffdaley
Copy link
Contributor Author

Moving to draft.

Want to make sure the changes in #144 are accounted for here.

@jeffdaley jeffdaley marked this pull request as ready for review April 28, 2023 22:19
},
true
);
// If the reauth message is shown, do nothing but restart the counter.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking of a situation where a user has multiple Hermes tabs open and the session expires: can/should we continue polling to check to see if the me API starts returning a 200 again? This way when the user re-auths in one tab, the flash message will go away in all the other tabs?

Copy link
Contributor

@jfreda jfreda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for addressing the Okta reauth use case!

@jeffdaley jeffdaley merged commit 423ee2b into main May 17, 2023
1 check passed
@jeffdaley jeffdaley deleted the jeffdaley/fix-poll-errors branch May 17, 2023 00:52
anuragprafulla pushed a commit to razorpay/hermes that referenced this pull request Jun 27, 2023
* Improve polling and reauthentication

* Cleanup

* Grammar fix

* Revert test changes

* Update authenticated-user.ts

* Update tests, types and documentation

* Cleanup and documentation

* Improve type accuracy

* Separate Okta/Google poll handling

* Copy tweaks

* Remove unnecessary polling rules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants