refactor(auth): unify Facebook and Google login into AuthPlatform class

Replace the separate FacebookLogin and GoogleLogin classes with a single
AuthPlatform class that takes a provider name ("facebook" | "google") as a
constructor argument. This consolidates duplicate OAuth sign-in logic behind
one entry point while preserving the existing NextAuth flow.

- Add new src/lib/auth/auth_platform.ts exporting AuthPlatform and
  AuthProvider type
- Update auth-facebook-panel.tsx and splash-button.tsx to use the new API
- Rename initialContext → initialState in the auth machine for consistency
- Update inline docs and comments to reference AuthPlatform

No behavioral change for end users; both providers still route through
NextAuth's signIn() with the same callbacks and cookies.
This commit is contained in:
2026-06-10 18:58:15 +08:00
parent 744e23fc29
commit 47591be41c
30 changed files with 111 additions and 117 deletions
+2 -1
View File
@@ -8,7 +8,8 @@
* - Context 形状与初始值位于 sidebar-context.ts
* - 事件联合位于 sidebar-events.ts
*/
export * from "./sidebar-state";
export * from "./sidebar-context";
export * from "./sidebar-events";
export * from "./sidebar-types";
export { sidebarMachine } from "./sidebar-machine";
export { sidebarMachine } from "./machine/sidebar-machine";