fix(auth): handle logout and refresh results

Propagate storage Result failures through logout, guest restoration, token refresh, and user state actors. Clear invalid sessions after failed automatic refreshes and cover both business and guest flows.
This commit is contained in:
2026-07-13 17:23:54 +08:00
parent eba01fe637
commit 225d232763
5 changed files with 388 additions and 89 deletions
+2 -1
View File
@@ -87,5 +87,6 @@ export const userFetchActor = fromPromise<UserFetchData>(async () => {
* - onDone / onError 都跑 `clearUser` actionmachine 层)—— 失败也清本地
*/
export const userLogoutActor = fromPromise<void>(async () => {
await getAuthRepository().logout();
const result = await getAuthRepository().logout();
if (Result.isErr(result)) throw result.error;
});