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:
Vendored
+1
-1
@@ -3,7 +3,7 @@ import "next-auth";
|
||||
/**
|
||||
* 扩展 next-auth v4 的 Session 类型
|
||||
*
|
||||
* `src/lib/auth/nextauth.ts` 的 jwt/session callbacks 把
|
||||
* `src/app/api/auth/[...nextauth]/route.ts` 的 jwt/session callbacks 把
|
||||
* - OAuth provider 名("google" | "facebook")
|
||||
* - Google id_token
|
||||
* - Facebook access_token
|
||||
|
||||
Reference in New Issue
Block a user