Enhance Robustness of auth-js Middleware
index.ts:
- 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.
- fix #741
- Removed redundant configuration checks already handled in @auth/core.
- fix #817
docs:
- In the default example, use
basePathas it aligns with v5 behavior where the host is inferred from request headers. SettingAUTH_URLis 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!
š¦ Changeset detected
Latest commit: a149c1ec303a04d3110a3d8c02849a50eb21bc5f
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @hono/auth-js | Major |
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?
@yusukebe
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 next-auth . Also setting AUTH_URL completley bypasses it. It should not be removed instead we can mention in doc how to mitigate it if people are not using webserver but I doubt that if anyone is deploying any application without webserver in production.