refactor(auth): inline NextAuth v4 config and simplify AuthPlatform API

- Inline NextAuth v4 handler directly in `[...nextauth]/route.ts`, removing
  the `@/lib/auth/nextauth` abstraction layer
- Add Google/Facebook providers with JWT/session callbacks that expose
  `idToken` and `accessToken` on the session for backend exchange
- Refactor `AuthPlatform` from constructor-based to static methods
  (`googleSignIn()` / `facebookSignIn()`)
- Update `auth-machine.ts` and layout comment reference to match new structure
- Align with original Dart `nextauth-helpers.{googleLogin, facebookLogin}()`
  naming and keep persistence concerns (unstorage, backend, custom cookies)
  out of scope for this iteration
This commit is contained in:
2026-06-12 17:20:56 +08:00
parent 1f83171067
commit dbc9a0cd13
6 changed files with 69 additions and 93 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ export default function RootLayout({
}>) {
return (
// suppressHydrationWarningnext/font + Tailwind v4 偶发类名差异;详见
// `src/lib/auth/nextauth.ts` 的"水合闪屏"说明。
// `src/app/api/auth/[...nextauth]/route.ts` 的"水合闪屏"说明。
<html
lang="en"
suppressHydrationWarning