支持自部署需求管理、交付流程与飞书集成
This commit is contained in:
1 parent
4556a5b483
commit
e22b66d9dd
148 files changed
+8300
-6393
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import { assertSameOrigin, authFailure, jsonResponse, loginWithPassword, readJsonObject, sessionCookie } from '@/lib/server/auth';
|
||||
|
||||
export const runtime = 'nodejs';
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export async function POST(request: Request) {
|
||||
try {
|
||||
assertSameOrigin(request);
|
||||
const body = await readJsonObject(request);
|
||||
const { user, token } = await loginWithPassword(body.username, body.password, request);
|
||||
return jsonResponse({ user }, 200, sessionCookie(token, request));
|
||||
} catch (error) { return authFailure(error); }
|
||||
}
|
||||
Reference in new issue
Block a user