mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-14 03:30:19 +00:00
🐛 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:
@@ -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' })),
|
||||
|
||||
Reference in New Issue
Block a user