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

[Issue #3043] Next login flow client #3215

Merged
merged 6 commits into from
Dec 18, 2024

Conversation

doug-s-nava
Copy link
Collaborator

@doug-s-nava doug-s-nava commented Dec 13, 2024

Summary

Fixes #3043

Time to review: 20 mins

Changes proposed

Adds a context provider and hook to allow client components to access up to date logged in user information.

A NextJS route was added to return user data decrypted from the session cookie passed up from the client.

Some updates were made to the feature flags table in order for that page to act as a proof of concept for the functionality. These changes should be reverted before the feature goes live, but in the meantime are useful for testing.

Some feature flags and loading spinner code was moved to a more suitable location.

Context for reviewers

Test steps

  1. run npm run dev on this branch in a new private window
  2. visit http://localhost:3000/dev/feature-flags
  3. VERIFY: you see a loading spinner followed by a page with a message saying "not logged in"
  4. visit http://localhost:3000/api/auth/callback?token=anyStringYouWant2Use
  5. visit http://localhost:3000/dev/feature-flags or hit "back" on your browser
  6. VERIFY: feature flags page loads with message "Logged in with token: anyStringYouWant2Use"
  7. refresh page with network tab of dev tools open
  8. VERIFY: only one request to /api/auth/session is made
  9. throw an error from line 8 of the session route handler file
  10. refresh
  11. VERIFY: the error details are printed out

Additional information

Follow up

@doug-s-nava doug-s-nava changed the title Next login flow client [Issue #3043] Next login flow client Dec 13, 2024
Base automatically changed from next-login-flow-backend to feature/nextjs-auth December 16, 2024 16:09
@doug-s-nava doug-s-nava force-pushed the next-login-flow-client branch from fb4a81a to 514640b Compare December 16, 2024 18:03
@doug-s-nava doug-s-nava marked this pull request as ready for review December 16, 2024 21:54
}
```

> ⚠️ Make sure you store the secret in SSM Parameter Store before you try to add secrets to your application service, or else the service won't be able to start since the ECS Task Executor won't be able to fetch the configured secret.
> ⚠️ For secrets with `manage_method = "manual"`, make sure you store the secret in SSM Parameter Store _before_ you try to add configure your application service with the secrets, or else the service won't be able to start since the ECS Task Executor won't be able to fetch the configured secret.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume you pulled this from platform verbatim and therefore it LGTM

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yup, this is copypasta

@doug-s-nava doug-s-nava force-pushed the next-login-flow-client branch from 2009862 to 12f3234 Compare December 17, 2024 17:23
Copy link
Collaborator

@mdragon mdragon 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.

Copy link
Collaborator

@acouch acouch left a comment

Choose a reason for hiding this comment

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

👍🏿

@doug-s-nava doug-s-nava merged commit 06deaf3 into feature/nextjs-auth Dec 18, 2024
8 checks passed
@doug-s-nava doug-s-nava deleted the next-login-flow-client branch December 18, 2024 18:10
doug-s-nava added a commit that referenced this pull request Dec 30, 2024
* adds a context provider and hook to allow client components to access up to date logged in user information
* adds a NextJS route to return user data decrypted from the session cookie passed up from the client
* makes some temporary updates to the feature flags table in order for that page
to act as a proof of concept for the functionality
* moves some feature flags and loading spinner code to a more suitable location.
doug-s-nava added a commit that referenced this pull request Jan 2, 2025
* adds a context provider and hook to allow client components to access up to date logged in user information
* adds a NextJS route to return user data decrypted from the session cookie passed up from the client
* makes some temporary updates to the feature flags table in order for that page
to act as a proof of concept for the functionality
* moves some feature flags and loading spinner code to a more suitable location.
doug-s-nava added a commit that referenced this pull request Jan 7, 2025
* adds a context provider and hook to allow client components to access up to date logged in user information
* adds a NextJS route to return user data decrypted from the session cookie passed up from the client
* makes some temporary updates to the feature flags table in order for that page
to act as a proof of concept for the functionality
* moves some feature flags and loading spinner code to a more suitable location.
acouch pushed a commit that referenced this pull request Jan 13, 2025
* adds a context provider and hook to allow client components to access up to date logged in user information
* adds a NextJS route to return user data decrypted from the session cookie passed up from the client
* makes some temporary updates to the feature flags table in order for that page
to act as a proof of concept for the functionality
* moves some feature flags and loading spinner code to a more suitable location.
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.

4 participants