fix(auth): return to guest session on logout
This commit is contained in:
@@ -94,10 +94,12 @@ export const oauthSignInActor = fromPromise<void, AuthProvider>(async ({ input }
|
||||
}
|
||||
});
|
||||
|
||||
export const logoutActor = fromPromise<void>(async () => {
|
||||
export const logoutActor = fromPromise<LoginStatus>(async () => {
|
||||
const authRepo = getAuthRepository();
|
||||
const result = await authRepo.logout();
|
||||
const deviceId = await deviceIdentifier.getDeviceId();
|
||||
const result = await authRepo.logoutToGuest(deviceId);
|
||||
if (Result.isErr(result)) throw result.error;
|
||||
return "guest" as LoginStatus;
|
||||
});
|
||||
|
||||
// ========== OAuth token → 后端业务 token sync actors ==========
|
||||
|
||||
Reference in New Issue
Block a user