fix: treat a logged-out launcher (autologin off, token 0) as needing login

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ysj7705andClaude Opus 5.5 committed 2026-10-24 21:43:56 +09:00
1 parent 7513fef6f8
commit 8774e850b6
2 files changed
+10 -2

No files matched your search

+8 -1
View File
@@ -4,7 +4,7 @@ import unittest
from mudfish_decky.client import AuthError, MudfishClient, MudfishError, SigninError
BASE = "http://127.0.0.1:8282"
SIGNED_OUT = {"status": 200, "isSignedIn": False, "username": "u", "token_v3": "123",
SIGNED_OUT = {"status": 200, "isSignedIn": False, "autologin": True, "username": "u", "token_v3": "123",
"item_conf_mode": "simple", "version": "6.6.0", "api_server": "api.mudfish.net", "jwt": ""}
SIGNIN_OK = {"status": 200, "token_v3": "456", "jwt": "JWT", "expert_mode": 0, "lang": "ko_KR", "alias_enable": 0}
@@ -100,6 +100,13 @@ class ClientTest(unittest.TestCase):
with self.assertRaises(SigninError):
MudfishClient(BASE, t).ensure_signed_in()
def test_logged_out_launcher_is_signin_error_without_calling_cloud(self):
# After /logout.html the launcher reports autologin=False and token_v3="0".
t = FakeTransport({("GET", BASE + "/do/mudrun/status"): [dict(SIGNED_OUT, autologin=False, token_v3="0")]})
with self.assertRaises(SigninError):
MudfishClient(BASE, t).ensure_signed_in()
self.assertEqual(t.calls_to("POST", "https://api.mudfish.net/signin_ng_v3"), [])
def test_graphql_without_user_is_auth_error(self):
t = FakeTransport({("POST", "https://api.mudfish.net/graphql"): [{"errors": ["unauthorized"]}]})
with self.assertRaises(AuthError):