0.3 增加登录模块
This commit is contained in:
@@ -28,13 +28,11 @@ export async function POST(request: Request) {
|
||||
return NextResponse.json({ error: "缺少 requestId/callId" }, { status: 400 });
|
||||
}
|
||||
|
||||
const userId = (() => {
|
||||
if (isConvexEnabled()) {
|
||||
const auth = requireAuthContext();
|
||||
return auth.userId;
|
||||
}
|
||||
return null;
|
||||
})();
|
||||
let userId: string | null = null;
|
||||
if (isConvexEnabled()) {
|
||||
const auth = await requireAuthContext();
|
||||
userId = auth.userId;
|
||||
}
|
||||
|
||||
const resolvedUserId = async () => {
|
||||
if (userId) return userId;
|
||||
|
||||
Reference in New Issue
Block a user