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

Navigating directly to the user dashboard URL causes a redirect #1490

Open
YangusKhan opened this issue Mar 2, 2021 · 0 comments
Open

Navigating directly to the user dashboard URL causes a redirect #1490

YangusKhan opened this issue Mar 2, 2021 · 0 comments
Labels

Comments

@YangusKhan
Copy link
Contributor

Bug Description
If you navigate directly to http://localhost/onestop/dashboard and have already signed in previously, the OneStop UI will trigger a redirect instead of showing the dashboard page. This behavior does not happen if you first go to another OneStop page and then click on the "Dashboard" link in the navigation menu.

Platform/Environment
Firefox 84, macOS Catalina 10.15.7

Severity
Severity: Low
Priority: Low

To Reproduce
Steps to reproduce the behavior:

  1. Have a running cluster with at least onestop-client and onestop-user pods.
  2. Go to the /onestop home page and click on the Login link in the navigation menu, and go through the login process.
  3. Navigate to /onestop/dashboard directly in your browser's top URL bar.

Expected Result
It should wait to load the user dashboard since you have already logged in for the current session.

Actual Result
It displays the message "User session expired. Redirecting to the login screen..." and then redirects the user to the login endpoint.

Additional context
I believe the proper fix should be in the UserDashboard component, specifically this part:

const dashboardOrRedirect =
    user && user.isAuthenticated ? (
      dashboardElement
    ) : (
      <LoginRedirectComponent
        loginEndpoint={loginEndpoint}
        configIsFetching={configIsFetching}
        user={user}
      />
    )

The above code could add another case incorporating user.isFetching and display a Loading component of some kind until user.isFetching is no longer true.

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

No branches or pull requests

1 participant