feat(web): add login page for desktop auth callback

- Add email/code login with verification
- Add Google OAuth login
- Add desktop callback API route
- Add request service with device ID handling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Naiyuan Qing 2026-02-13 12:25:03 +08:00
parent 2577475ba6
commit 108cf7ffb0
10 changed files with 527 additions and 9 deletions

View file

@ -0,0 +1,23 @@
import { NextRequest, NextResponse } from 'next/server';
/**
* Desktop Session API
*
* Cap/apps/web/app/api/desktop/[...route]/session.ts
*
*
* 1. Desktop URL port platform
* 2. /login?next=URL
* 3. login Desktop
*
* Web SID
*/
export async function GET(request: NextRequest) {
// Build current URL for next parameter
const currentUrl = request.nextUrl.toString();
// Always redirect to login page - no caching, always require fresh login
const loginUrl = new URL('/login', request.nextUrl.origin);
loginUrl.searchParams.set('next', currentUrl);
return NextResponse.redirect(loginUrl);
}