Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
There is too much information in the pull request to test. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df84d5e59d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return this.db.query.users.findFirst({ | ||
| where: eq(account.userId, result.userId), |
There was a problem hiding this comment.
Use users.id when querying users table
When a Logto/Casdoor webhook fires, getUserByAccount queries users with eq(account.userId, result.userId), but account isn’t part of the users query. Drizzle will emit SQL that references the account table without a join (or will never match), so webhook updates/sign-outs will fail to locate the user and either error or silently no-op. This should compare the users table’s primary key (e.g., users.id) to result.userId.
Useful? React with 👍 / 👎.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## next #11732 +/- ##
==========================================
+ Coverage 74.16% 74.44% +0.27%
==========================================
Files 1193 1191 -2
Lines 95004 94478 -526
Branches 12534 12501 -33
==========================================
- Hits 70464 70334 -130
+ Misses 24450 24054 -396
Partials 90 90
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
🚀 Desktop App Build Completed!Version: Build Artifacts
Warning Note: This is a temporary build for testing purposes only. |
91d2c2f to
5416506
Compare
Add migration tools for users upgrading from NextAuth to Better Auth: - Migration scripts to transfer SSO connections from nextauth_accounts to Better Auth accounts table - Support for test/prod modes with dry-run capability - Batch processing with progress tracking for resumable migrations - Verification script to validate migration results - Documentation in English and Chinese covering simple and full migration
- Add GitHub Issue link for feedback - Adjust user threshold to ≤ 10 users (align with Clerk docs) - Add note about manual re-binding of social accounts - Consolidate backup and dry-run reminders in Full Migration section - Simplify Step 6 by referencing Simple Migration steps
- Add green bold for success counts and messages - Add red bold for failure messages - Fix NextAuth scope conversion (space → comma separated) - Use deterministic id for account migration
- Delete src/libs/next-auth/ directory (19 files) - Delete NextAuth pages (signin, error) - Delete NextAuth layout provider and components - Delete NextAuthUserService, replace with WebhookUserService - Remove nextAuth field from TRPC context - Remove unlinkSSOProvider endpoint (NextAuth-specific) - Update middleware to only use Better Auth - Clean up related tests
- Remove enableNextAuth/enableBetterAuth exports from envs/auth.ts - Simplify auth route to directly use Better Auth handler - Remove conditional checks in middleware, context, and actions - Delete unnecessary layout files for auth pages - Update tests to remove NextAuth-related mocks and test cases - Fix profile/index.tsx to use isLoginWithBetterAuth only
- Remove isLoginWithBetterAuth selector, use isLogin instead
- Replace dynamic import('@/auth') with static imports
- Update profile and SSOProvidersList to use isLogin
- Add orderBy to topic.create.test.ts to ensure consistent query order - Revert getSessionUser.ts to dynamic import to avoid validator ESM/CJS issue during sitemap generation
- Remove NEXT_AUTH_* environment variables and fallback logic from auth.ts - Delete src/envs/auth.test.ts (NextAuth fallback tests) - Update docker-compose configs to use AUTH_SECRET/AUTH_SSO_PROVIDERS
- Add SSO provider environment variable check in prebuild - Add docs/self-hosting/advanced/redis/upstash.mdx documentation
Support separate sender address configuration for AWS SES and other services where SMTP_USER is not a valid email address.
Add environment variable declarations for: - Redis: REDIS_URL, REDIS_PREFIX, REDIS_TLS - Email: SMTP_*, RESEND_*, EMAIL_SERVICE_PROVIDER - Common SSO: Google, GitHub, Microsoft credentials
Support AUTH_ALLOWED_EMAILS env var to restrict registration to specific emails or domains (e.g., "example.com,admin@other.com")
- Refactor checkDeprecatedAuth.js with config-driven approach - Detect all NEXT_AUTH*/NEXTAUTH* env vars dynamically - Add check for NEXT_PUBLIC_AUTH_* deprecated vars - Remove NEXT_PUBLIC_* fallback in auth.ts - Use APIError instead of Error in email-whitelist plugin
- Rename NEXT_PUBLIC_AUTH_EMAIL_VERIFICATION to AUTH_EMAIL_VERIFICATION - Add AUTH_ALLOWED_EMAILS documentation for email whitelist feature - Add FAQ entry for restricting registration to specific emails/domains
- Replace instances of NEXT_PUBLIC_AUTH_EMAIL_VERIFICATION with AUTH_EMAIL_VERIFICATION in .env.example, e2e configurations, and documentation. - Update breaking changes documentation to reflect the new variable name for email verification requirement.
…Auth Add comprehensive environment variable migration reference including: - General variables mapping (NEXT_AUTH_SECRET → AUTH_SECRET, etc.) - SSO provider variables (most unchanged, Microsoft renamed) - New Better Auth feature variables (email whitelist, magic link, etc.)
…ion for compatibility
Replace AdapterAccount type import with local AccountType definition to completely remove next-auth package dependency.
Rewrite the authentication provider development guide to reflect the new Better Auth architecture, including: - Provider definition structure (builtin vs generic) - Environment variable configuration - Provider registration process
….20260122.4 and remove unused Session and User imports from auth initial state
Vercel uses Amazon Linux (glibc), not Alpine Linux (musl). This excludes unnecessary musl binaries saving ~45MB: - @napi-rs/canvas-*-musl: ~29MB - @img/sharp-libvips-*musl: ~16MB
Revert temporary changes made for debugging 250MB limit: - Remove NEXT_DEBUG_FUNCTION_SIZE from vercel.json - Remove better-call override - Restore better-auth packages to ^1.4.17 - Restore better-call to ^1.2.0 The outputFileTracingExcludes config is sufficient to fix the issue.
a167c3a to
077bdf7
Compare
|
❤️ Great PR @tjx666 ❤️ The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world. |
## [Version 2.0.0-next.356](v2.0.0-next.355...v2.0.0-next.356) <sup>Released on **2026-01-23**</sup> #### ✨ Features - **misc**: Remove NextAuth. #### 🐛 Bug Fixes - **editor**: Prevent crash when toggling enableInputMarkdown setting. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * **misc**: Remove NextAuth, closes [#11732](#11732) ([1eff864](1eff864)) #### What's fixed * **editor**: Prevent crash when toggling enableInputMarkdown setting, closes [#11755](#11755) ([ea5eed8](ea5eed8)) </details> <div align="right"> [](#readme-top) </div>
|
🎉 This PR is included in version 2.0.0-next.356 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [Version 1.154.0](v1.153.1...v1.154.0) <sup>Released on **2026-01-23**</sup> #### ♻ Code Refactoring - **misc**: Migrate AI Rules to Claude Code Skills. #### ✨ Features - **database**: Extended async task with metadata and parent id, added index. - **misc**: Remove NextAuth. #### 🐛 Bug Fixes - **copilot**: History popover not refreshing when agentId changes. - **editor**: Prevent crash when toggling enableInputMarkdown setting. - **home**: Use correct CreateGroupModal for session group creation. - **model-runtime**: Handle null content in anthropic message builder. - **ModelSelect**: Resolve tooltip hover causing popup to close. - **pdf**: Ensure worker config before Document render. - **store**: Delete message before regeneration. - **misc**: Fix auto scroll, fix favorite refresh bug and group topic refresh issue, fixed the agent group builder tools excaution edge case crash, page content switch mismatch, when use market group, the group sys role was not used. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Code refactoring * **misc**: Migrate AI Rules to Claude Code Skills, closes [lobehub#11737](https://github.com/jaworldwideorg/OneJA-Bot/issues/11737) ([346fc46](346fc46)) #### What's improved * **database**: Extended async task with metadata and parent id, added index, closes [lobehub#11712](https://github.com/jaworldwideorg/OneJA-Bot/issues/11712) ([31d2f26](31d2f26)) * **misc**: Remove NextAuth, closes [lobehub#11732](https://github.com/jaworldwideorg/OneJA-Bot/issues/11732) ([1eff864](1eff864)) #### What's fixed * **copilot**: History popover not refreshing when agentId changes, closes [lobehub#11731](https://github.com/jaworldwideorg/OneJA-Bot/issues/11731) ([64f39e7](64f39e7)) * **editor**: Prevent crash when toggling enableInputMarkdown setting, closes [lobehub#11755](https://github.com/jaworldwideorg/OneJA-Bot/issues/11755) ([ea5eed8](ea5eed8)) * **home**: Use correct CreateGroupModal for session group creation, closes [lobehub#11752](https://github.com/jaworldwideorg/OneJA-Bot/issues/11752) ([36bcc50](36bcc50)) * **model-runtime**: Handle null content in anthropic message builder, closes [lobehub#11756](https://github.com/jaworldwideorg/OneJA-Bot/issues/11756) ([539753a](539753a)) * **ModelSelect**: Resolve tooltip hover causing popup to close, closes [lobehub#11742](https://github.com/jaworldwideorg/OneJA-Bot/issues/11742) ([1b73f14](1b73f14)) * **pdf**: Ensure worker config before Document render, closes [lobehub#11746](https://github.com/jaworldwideorg/OneJA-Bot/issues/11746) ([ad34072](ad34072)) * **store**: Delete message before regeneration, closes [lobehub#11760](https://github.com/jaworldwideorg/OneJA-Bot/issues/11760) ([a8a6300](a8a6300)) * **misc**: Fix auto scroll, closes [lobehub#11734](https://github.com/jaworldwideorg/OneJA-Bot/issues/11734) ([892fa9f](892fa9f)) * **misc**: Fix favorite refresh bug and group topic refresh issue, closes [lobehub#11745](https://github.com/jaworldwideorg/OneJA-Bot/issues/11745) ([5d115ef](5d115ef)) * **misc**: Fixed the agent group builder tools excaution edge case crash, closes [lobehub#11735](https://github.com/jaworldwideorg/OneJA-Bot/issues/11735) ([5de4742](5de4742)) * **misc**: Page content switch mismatch, closes [lobehub#11758](https://github.com/jaworldwideorg/OneJA-Bot/issues/11758) ([fdc8f95](fdc8f95)) * **misc**: When use market group, the group sys role was not used, closes [lobehub#11739](https://github.com/jaworldwideorg/OneJA-Bot/issues/11739) ([afc76f9](afc76f9)) </details> <div align="right"> [](#readme-top) </div>
💻 Change Type
🔗 Related Issue
Closes #10456
🔀 Description of Change
This PR removes all NextAuth authentication code and simplifies the codebase since only Better Auth is now supported.
Key changes:
Environment variables cleanup (
src/envs/auth.ts):enableNextAuth/enableBetterAuthexportsSource code simplification (12+ files):
enableBetterAuth/enableNextAuthimport('@/auth')to static importsisLoginWithBetterAuthselector, useisLogindirectlyDeleted files:
src/app/[variants]/(auth)/signin/layout.tsxsrc/app/[variants]/(auth)/reset-password/layout.tsxsrc/app/[variants]/(auth)/verify-email/layout.tsxTest updates (10 files):
@/authmock for Better AuthDocumentation updates:
legacy.mdxandlegacy.zh-CN.mdxbreaking-changes.mdxandbreaking-changes.zh-CN.mdxwith migration links🧪 How to Test
Test commands:
bun run type-check bunx vitest run --silent='passed-only'📸 Screenshots / Videos
N/A - No UI changes
📝 Additional Information
Breaking changes: