Skip to content

Add welcome mat with homepage redirects

⚠️ Add environment variable to cg-ui before merging/deploying:

NEXT_PUBLIC_BLOG_FEED_URL=https://cloud.gov/updates.xml

Changes proposed in this pull request:

  • Redirects users to /login when navigating to root / and not authenticated
  • When authenticated and navigating to root, redirect users to one of their orgs: /orgs/:org_id
    • When lastViewedOrgId is set, take them to this org
    • If not, then make a CAPI request to get their first org and take them there
  • Implements welcome mat design for /orgs/:org_id as specified in #529 (closed)
  • Pulls in real blog data from https://cloud.gov/updates.xml

How to test

  • add NEXT_PUBLIC_BLOG_FEED_URL=https://cloud.gov/updates.xml to .env.local
  • Spin up a uaa-docker container (instructions)
  • Log into the CF CLI
  • Run the dev server npm run dev-cf
  • Try to access / - you should be redirected to UAA login
  • Use the credentials found in /uaa-docker/uaa.yml to log in
  • After log in, you should be redirected to /orgs/:org_id

Related issues

Closes #529 (closed)

Submitter checklist

  • Added logging is not capturing sensitive data and is set to an appropriate level (DEBUG vs INFO etc)
  • Updated relevant documentation (README, ADRs, explainers, diagrams)

Security considerations

Uses org id stored in cookie to make CF API requests in order to show the content on the page

Merge request reports

Loading