feat(auth): add startup auth status check with device id fallback
Add AuthStatusChecker mounted in RootProviders to dispatch AuthStatusCheckSubmitted on mount. The new checkAuthStatusActor retrieves the device id, checks for an existing login or guest token, and falls back to a guest login API call when neither is present. Wires the new event/actor through the auth machine to enable automatic session restoration and guest-mode bootstrap.
This commit is contained in:
@@ -13,6 +13,8 @@ export type AuthEvent =
|
||||
| { type: "AuthModeChanged"; mode: AuthMode }
|
||||
| { type: "AuthFormCleared" }
|
||||
| { type: "AuthReset" }
|
||||
/** 启动 / 恢复时检查登录态 —— 拿 deviceId → 查 token → 必要时游客登录 */
|
||||
| { type: "AuthStatusCheckSubmitted" }
|
||||
// 业务事件(提交)
|
||||
| { type: "AuthEmailLoginSubmitted"; email: string; password: string }
|
||||
| {
|
||||
|
||||
Reference in New Issue
Block a user