Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix: limit check-user response surface (#10609)

YuTengjing2f6d3f01722c
diff --git a/src/app/(backend)/api/auth/check-user/route.ts b/src/app/(backend)/api/auth/check-user/route.ts
index 04e12481d30..941821e8601 100644
--- a/src/app/(backend)/api/auth/check-user/route.ts
+++ b/src/app/(backend)/api/auth/check-user/route.ts
@@ -6,10 +6,8 @@ import { users } from '@/database/schemas/user';
import { serverDB } from '@/database/server';
export interface CheckUserResponseData {
- emailVerified?: boolean;
exists: boolean;
hasPassword?: boolean;
- providers?: string[];
}
/**
@@ -47,18 +45,14 @@ export async function POST(req: NextRequest) {
})
.from(account)
.where(and(eq(account.userId, user.id)));
-
- const providers = Array.from(new Set(accounts.map((a) => a.providerId).filter(Boolean)));
const hasPassword = accounts.some(
(a) =>
a.providerId === 'credential' && typeof a.password === 'string' && a.password.length > 0,
);
return NextResponse.json({
- emailVerified: user.emailVerified,
exists: true,
hasPassword,
- providers,
} satisfies CheckUserResponseData);
} catch (error) {
console.error('Error checking user existence:', error);