refactor(auth): simplify splash guest entry
This commit is contained in:
@@ -36,12 +36,6 @@ interface AuthState {
|
||||
loginStatus: MachineContext["loginStatus"];
|
||||
/** 启动时的本地登录态恢复是否已经完成 */
|
||||
hasInitialized: MachineContext["hasInitialized"];
|
||||
/**
|
||||
* 一次性的"刚按了"信号 —— Skip / Facebook / 邮箱登录按钮派完业务事件后置 true,
|
||||
* splash-screen / auth-screen 看到 `pendingRedirect && loginStatus !== "notLoggedIn"`
|
||||
* 触发跳转 + 调 `AuthClearPendingRedirect` 置 false。
|
||||
*/
|
||||
pendingRedirect: boolean;
|
||||
}
|
||||
|
||||
const AuthStateCtx = createContext<AuthState | null>(null);
|
||||
@@ -64,7 +58,7 @@ export function AuthProvider({ children }: AuthProviderProps) {
|
||||
username: state.context.username,
|
||||
confirmPassword: state.context.confirmPassword,
|
||||
// isLoading 覆盖邮箱登录 / 邮箱注册 / OAuth 跳转(NextAuth 重定向期间)/
|
||||
// OAuth 回调后端 sync / 显式游客登录
|
||||
// OAuth 回调后端 sync / 自动游客登录
|
||||
isLoading:
|
||||
state.matches("loadingEmailLogin") ||
|
||||
state.matches("loadingEmailRegister") ||
|
||||
@@ -77,7 +71,6 @@ export function AuthProvider({ children }: AuthProviderProps) {
|
||||
errorMessage: state.context.errorMessage,
|
||||
loginStatus: state.context.loginStatus,
|
||||
hasInitialized: state.context.hasInitialized,
|
||||
pendingRedirect: state.context.pendingRedirect,
|
||||
}),
|
||||
[state],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user