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

Redirect to signin for unauthenticated users on the Review information form #33812

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nicksayre
Copy link
Contributor

@nicksayre nicksayre commented Dec 30, 2024

Note: Delete the description statements, complete each step. None are optional, but can be justified as to why they cannot be completed as written. Provide known gaps to testing that may raise the risk of merging to production.

Are you removing, renaming or moving a folder in this PR?

  • No, I'm not changing any folders (skip to TeamSites and delete the rest of this section)
  • Yes, I'm removing, renaming or moving a folder

If the folder you changed contains a manifest.json, search for its entryName in the content-build registry.json (the entryName there will match).

If an entry for this folder exists in content-build and you are:

  1. Deleting a folder:

    1. First search vets-website for all instances of the entryName in your manifest.json and remove them in a separate PR. Look particularly for references in src/applications/static-pages/static-pages-entry.js and src/platform/forms/constants.js. If you do not do this, other applications will break!
      • Add the link to your merged vets-website PR here
    2. Then, Delete the application entry in registry.json and merge that PR before this one
      • Add the link to your merged content-build PR here
  2. Renaming or moving a folder: Update the entry in the registry.json, but do not merge it until your vets-website changes here are merged. The content-build PR must be merged immediately after your vets-website change is merged in to avoid CI errors with content-build (and Tugboat).

⚠️ TeamSites ⚠️

Examples of a TeamSite: https://va.gov/health and https://benefits.va.gov/benefits/. This scenario is also referred to as the "injected" header and footer. You can reach out in the #sitewide-public-websites Slack channel for questions.

Did you change site-wide styles, platform utilities or other infrastructure?

Summary

  • Wrapped this application in the <RequiredLoginView> component which causes unauthenticated users to be routed to a sign-in flow before returning
    • I work for VA IIR and we own this application

Related issue(s)

Testing done

The old behavior: the user sees a broken version of the page with red text indicating that sign-in is required.

To verify that this is working

  1. Run the entire stack with yarn watch.
  2. In another console run a mock api: yarn mock-api --responses src/applications/personalization/profile/mocks/server.js
  3. Visit http://localhost:3001/my-va/welcome-va-setup/review-information/contact-information
  4. If you are already signed-in, open the JavaScript console and sign out withlocalStorage.setItem('hasSession', false)
  5. Refresh the site. You should see that you are redirected to the sign-in form
  6. Don't forget to sign in again using the JS console: localStorage.setItem('hasSession', true)

Screenshots

Note: This field is mandatory for UI changes (non-component work should NOT have screenshots).

Before After
Mobile m-before m-after
Desktop d-before d-after

What areas of the site does it impact?

This only impacts the Review Information form.

Acceptance criteria

  • When unauthenticated, the user is redirected to the sign-in form.

Quality Assurance & Testing

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Linting warnings have been addressed
  • Documentation has been updated (link to documentation *if necessary)
  • Screenshot of the developed feature is added
  • Accessibility testing has been performed

Error Handling

  • Browser console contains no warnings or errors.
  • Events are being sent to the appropriate logging solution
  • Feature/bug has a monitor built into Datadog or Grafana (if applicable)

Authentication

  • Did you login to a local build and verify all authenticated routes work as expected with a test user

Requested Feedback

(OPTIONAL) What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?

@va-vfs-bot va-vfs-bot temporarily deployed to master/personalization/review-information/1321-authentication/main December 30, 2024 23:11 Inactive
@nicksayre nicksayre force-pushed the personalization/review-information/1321-authentication branch from 8d57823 to 6b1fc5c Compare December 30, 2024 23:13
@va-vfs-bot va-vfs-bot temporarily deployed to master/personalization/review-information/1321-authentication/main December 30, 2024 23:30 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/personalization/review-information/1321-authentication/main December 31, 2024 00:07 Inactive
Copy link

@kpethtel kpethtel left a comment

Choose a reason for hiding this comment

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

When I went to the page, I was not initially logged in, but otherwise, looks good!

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.

3 participants