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

feat(adapter-nextjs): server-side auth flows integrating cognio hosted UI #13827

Open
wants to merge 3 commits into
base: hui/feat/adapter-nextjs/2-auth-api-handlers
Choose a base branch
from

Conversation

HuiSF
Copy link
Member

@HuiSF HuiSF commented Sep 19, 2024

Description of changes

Implemented the following flow integrating Cognito Hosted UI endpoints:

  1. sign-in -> Hosted UI -> sign-in-callback (including Social Providers) -> httpOnly cookies
  2. sign-up -> Hosted UI -> sign-in-callback -> httpOnly cookies
  3. sign-out -> Hosted UI -> sign-out-callback -> httpOnly cookies

API Route handlers work with both Next.js App Router and Pages Router.

Issue #, if available

Description of how you validated changes

  1. Unit tests
  2. Manual testing with Next.js samples apps created with the App Router and Pages Router

Checklist

  • PR description included
  • yarn test passes
  • Unit Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

Checklist for repo maintainers

  • Verify E2E tests for existing workflows are working as expected or add E2E tests for newly added workflows
  • New source file paths included in this PR have been added to CODEOWNERS, if appropriate

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
…ide auth…ide auth…ide auth

"alwaysStrict": true
"alwaysStrict": true,
"lib": [
"esnext"
Copy link
Member Author

Choose a reason for hiding this comment

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

The base tsconfig has jsdom as a lib, that makes origin variable a legit global variable which is not desired.

Copy link
Member Author

Choose a reason for hiding this comment

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

Existing impl. moved out.

Copy link
Member Author

Choose a reason for hiding this comment

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

Existing impl. moved out.

@ashika112 ashika112 changed the title eat(adapter-nextjs): server-side auth flows integrating cognio hosted UI feat(adapter-nextjs): server-side auth flows integrating cognio hosted UI Sep 19, 2024
@HuiSF HuiSF force-pushed the hui/feat/adapter-nextjs/3-auth-api-handlers-impl branch from 6087817 to ae36b32 Compare September 19, 2024 17:23
Comment on lines +61 to +63
path: '/',
httpOnly: true,
secure: true,
Copy link
Member Author

Choose a reason for hiding this comment

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

These three attributes are not configurable.

@HuiSF HuiSF force-pushed the hui/feat/adapter-nextjs/3-auth-api-handlers-impl branch from ae36b32 to 621d0cb Compare September 19, 2024 18:26
@HuiSF HuiSF force-pushed the hui/feat/adapter-nextjs/2-auth-api-handlers branch from 25c4eaa to 26ec9ed Compare October 1, 2024 23:02
@HuiSF HuiSF force-pushed the hui/feat/adapter-nextjs/3-auth-api-handlers-impl branch from 621d0cb to 284acbf Compare October 1, 2024 23:02
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.

1 participant