🐛 fix(server): resolve CI lint and test failures after canary merge

- Drop stale packages/business-server/src/better-auth.ts (removed in #15589
  but accidentally re-introduced during rebase) — fixes missing
  better-auth-harmony types.
- Relax casdoor/logto webhook route signatures from NextResponse to Response
  to match the WebhookUserService now returning Web Response.
- Mock createAuthEndpoint in define-config.test.ts so the devLocalLogin
  plugin can be constructed under the better-auth/plugins mock.
This commit is contained in:
Innei
2026-06-09 21:44:20 +08:00
parent 30835b27d2
commit 8d6aa3b196
4 changed files with 3 additions and 9 deletions
@@ -1,7 +0,0 @@
import type { emailHarmony } from 'better-auth-harmony';
export type BusinessEmailHarmonyOptions = NonNullable<Parameters<typeof emailHarmony>[0]>;
export const businessEmailHarmonyOptions = {
allowNormalizedSignin: false,
} satisfies BusinessEmailHarmonyOptions;
@@ -6,7 +6,7 @@ import { WebhookUserService } from '@/server/services/webhookUser';
import { validateRequest } from './validateRequest';
export const POST = async (req: Request): Promise<NextResponse> => {
export const POST = async (req: Request): Promise<Response> => {
const payload = await validateRequest(req, authEnv.CASDOOR_WEBHOOK_SECRET);
if (!payload) {
@@ -6,7 +6,7 @@ import { WebhookUserService } from '@/server/services/webhookUser';
import { validateRequest } from './validateRequest';
export const POST = async (req: Request): Promise<NextResponse> => {
export const POST = async (req: Request): Promise<Response> => {
const payload = await validateRequest(req, authEnv.LOGTO_WEBHOOK_SIGNING_KEY!);
if (!payload) {
@@ -40,6 +40,7 @@ vi.mock('better-auth/minimal', () => ({
vi.mock('better-auth/plugins', () => ({
admin: vi.fn(() => ({ id: 'admin' })),
createAuthEndpoint: vi.fn(() => vi.fn()),
emailOTP: vi.fn(() => ({ id: 'email-otp' })),
genericOAuth: vi.fn(() => ({ id: 'generic-oauth' })),
magicLink: vi.fn(() => ({ id: 'magic-link' })),