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

Use SessionStorage to refresh every hour on OAuth issues #798

Merged

Conversation

andrewballantyne
Copy link
Member

Resolves: #770

Description

Use sessionStorage to hold onto a timestamp. If 1h has passed since the last timestamp, and we run into an OAuth issue (because of token expiration) we should auto refresh.

Note: This value is not persisted past the life of the tab. So it will always refresh once on startup if it runs into the problem, no matter the time since the last time it did.

How Has This Been Tested?

I caused an error in the OAuth code to cause the error -- this is not really testable outside of an OAuth expiration (which cannot happen locally in dev mode). Which seems to happen 24-48h after your tab has been left on the dashboard. This hasn't been fully verified, but it appears to be the best understanding we have right now.

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

Copy link
Member

@DaoDaoNoCode DaoDaoNoCode left a comment

Choose a reason for hiding this comment

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

lgtm

@lucferbux
Copy link
Contributor

Tested it, can confirm that if you clear the date or change it manually to an hour prior, it works reloading it only one time.
Code seems fine, it's a lgtm

Screen.Recording.2022-11-24.at.13.16.35.mov

Copy link
Contributor

@lucferbux lucferbux left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 24, 2022

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: DaoDaoNoCode, lucferbux

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit b18d47a into opendatahub-io:main Nov 24, 2022
strangiato pushed a commit to strangiato/odh-dashboard that referenced this pull request Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Logout Needs to Auto Refresh For the User N Times Per Duration
4 participants