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

Private Routes Guard #483

Merged
merged 17 commits into from
Sep 20, 2024
Merged

Private Routes Guard #483

merged 17 commits into from
Sep 20, 2024

Conversation

g-saracca
Copy link
Contributor

@g-saracca g-saracca commented Sep 9, 2024

What this PR does / why we need it:

Adds protection for routes intended for logged-in users only.
If a not logged in user arrives at a protected path, the user will be automatically redirected to the JSF login page.
It currently applies to the following routes:

  • Create Collection page - /spa/collections/[ownerCollectionId]/create
  • Create Dataset page - `/spa/datasets/[collectionId]/create
  • Edit Dataset Metadata page - /spa/datasets/edit-metadata?persistentId=[pid]
  • Upload Files page - /spa/datasets/upload-files?persistentId=[pid]
  • Account page - /spa/account?tab=apiToken or /spa/account

Which issue(s) this PR closes:

Special notes for your reviewer:

N/A

Suggestions on how to test this:

Create a collection and a dataset.
Go to the 5 pages mentioned above, copy the URL and open it in another browser or in an incognito window (to test without being logged in) and confirm that you are redirected to the JSF login page.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

No, it only shows a spinner if a protected route is loading the user session.

@coveralls
Copy link

coveralls commented Sep 9, 2024

Coverage Status

coverage: 97.43% (+0.006%) from 97.424%
when pulling bf789be on feat/435-private-routes-guard
into b6484bf on develop.

@g-saracca g-saracca added Size: 3 A percentage of a sprint. 2.1 hours. GREI Re-arch GREI re-architecture-related SPA: Permissions FY25 Sprint 5 FY25 sprint 5 labels Sep 9, 2024
@g-saracca g-saracca marked this pull request as ready for review September 9, 2024 19:20
@g-saracca g-saracca added the SPA.Q3 Not related to any specific Q3 feature label Sep 19, 2024
@g-saracca g-saracca removed the Waiting label Sep 19, 2024
@g-saracca g-saracca removed their assignment Sep 19, 2024
@ekraffmiller ekraffmiller self-assigned this Sep 19, 2024
Copy link
Contributor

@ekraffmiller ekraffmiller 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! Just a minor question about Spinner.

@ekraffmiller ekraffmiller removed their assignment Sep 19, 2024
@ChengShi-1 ChengShi-1 self-requested a review September 20, 2024 20:29
Copy link
Contributor

@ChengShi-1 ChengShi-1 left a comment

Choose a reason for hiding this comment

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

Everything work well1. I checked that an unauthorized user couldn't access pages through url. Approve

@ChengShi-1 ChengShi-1 merged commit 8cf113d into develop Sep 20, 2024
10 of 14 checks passed
@ChengShi-1 ChengShi-1 deleted the feat/435-private-routes-guard branch September 20, 2024 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 5 FY25 sprint 5 GREI Re-arch GREI re-architecture-related Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours. SPA: Permissions SPA.Q3 Not related to any specific Q3 feature
Projects
Status: Done 🧹
Development

Successfully merging this pull request may close these issues.

SPA Private Routes Guards
6 participants