-
Notifications
You must be signed in to change notification settings - Fork 151
[next]: Add Authentication POC #2173
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
base: next
Are you sure you want to change the base?
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements authentication functionality for the Faust.js framework, introducing a new @faustjs/auth
package and integrating authentication features into the Next.js kitchen-sink example. The implementation includes user login/logout, session management, and authenticated GraphQL requests.
- Adds authentication hooks (
useLogin
,useLogout
,useUser
) for Next.js applications - Implements session-based authentication with token refresh capabilities
- Integrates login UI and user session management into the example app
Reviewed Changes
Copilot reviewed 23 out of 25 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
packages/auth/* | New authentication package with handlers, configuration, and session management |
packages/nextjs/pages/auth/* | Authentication hooks for React components |
packages/graphql/client.js | Enhanced GraphQL client to support request headers for authenticated requests |
examples/nextjs/kitchen-sink/src/components/* | Login component and header with authentication UI |
examples/nextjs/kitchen-sink/src/pages/* | API routes for session management and alternative preview approach |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 23 out of 25 changed files in this pull request and generated 4 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Description
This PR implements authentication functionality to the Next.js kitchen-sink example and adds a new
@faustjs/auth
package. The major changes include implementing login, logout, and user session management hooks, integrating these features into the example app's UI, and updating dependencies and configuration to support authentication.Authentication feature integration:
@faustjs/auth
package, including its configuration defaults and peer dependencies (iron-session
,jsonwebtoken
).useLogin
,useLogout
,useUser
) inpackages/nextjs/pages/auth/hooks/
, and exported them for use in Next.js apps.Kitchen-sink example app updates:
Header
component, including a modal-based login form and user dropdown./api/session/[action].js
for session actions usingauthRouter
and the new session configuration.Supporting improvements:
Enhanced the GraphQL client to allow passing additional request headers, supporting authenticated requests.
Related Issue(s):