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:
@@ -87,5 +87,6 @@ export const userFetchActor = fromPromise<UserFetchData>(async () => {
|
||||
* - onDone / onError 都跑 `clearUser` action(machine 层)—— 失败也清本地
|
||||
*/
|
||||
export const userLogoutActor = fromPromise<void>(async () => {
|
||||
await getAuthRepository().logout();
|
||||
const result = await getAuthRepository().logout();
|
||||
if (Result.isErr(result)) throw result.error;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user