-
Notifications
You must be signed in to change notification settings - Fork 174
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
Enhance Robustness of auth-js Middleware #818
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: a149c1e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Hi @catnaut Is this ready for review? |
…n handling - Refactored getSession based on https://github.com/nextauthjs/next-auth/blob/main/packages/frameworks-express/src/index.ts for improved alignment. - Replaced redundant Env handling with @auth/core's setEnvDefaults for cleaner configuration. - Removed redundant configuration checks already handled in @auth/core.
In the default example, use `basePath` as it aligns with v5 behavior where the host is inferred from request headers. Setting `AUTH_URL` is only necessary if a custom base path is needed. (e.g., `AUTH_URL=http://localhost:3000/web/auth`)
Yup, it's all set and ready for your review! 😊 |
@catnaut Thanks! Hi @divyam234, Sorry to bother you. Can you review this? |
@catnaut Usually handling of x-forwarded headers is handled at webserver like nginx or caddy so that it's not tampered with in first place for nextjs its already handled by vercel so current solution is valid for |
index.ts:
docs:
basePath
as it aligns with v5 behavior where the host is inferred from request headers. SettingAUTH_URL
is only necessary if a custom base path is needed.(https://authjs.dev/getting-started/deployment#auth_url)This is my first attempt at backend development, and I would really appreciate a thorough review and any suggestions. I’m still learning and want to make sure everything is implemented correctly. Thank you for your help!