Fix: Can't log in after token expires

This commit is contained in:
MemoryShadow 2022-08-01 20:18:15 +08:00
parent 71f79ba87e
commit 131128e30c
2 changed files with 5 additions and 3 deletions

1
.gitignore vendored
View File

@ -86,3 +86,4 @@ sftp-config.json
### pyCraft ###
credentials
Persistence/*

View File

@ -442,10 +442,11 @@ class Microsoft_AuthenticationToken(object):
XSTS = self.GetXSTS(XBL['Token'])
XBOX = self.GetXBOX(XSTS['Token'],XSTS['uhs'])
if self.GetProfile(XBOX):
print(f'账户: {self.profile.id_}')
self.PersistenceLogoin_w()
print(f'account: {self.profile.id_}')
return True
else:
print('账户不存在')
print('Account does not exist')
return False
def join(self, server_id):
@ -501,7 +502,7 @@ class Microsoft_AuthenticationToken(object):
Persistence = json.loads(Persistence)
self.access_token = Persistence["access_token"]
self.oauth20_refresh_token = Persistence["oauth20_refresh_token"]
self.GetProfile(self.access_token)
self.refresh()
return self.authenticated
else:
return False