token changes for minecraft compatibility
This commit is contained in:
parent
0739e3a8d9
commit
9a19b417bf
1 changed files with 4 additions and 4 deletions
|
@ -45,9 +45,9 @@ class Token:
|
||||||
def dict(self):
|
def dict(self):
|
||||||
return {
|
return {
|
||||||
"username":self.username,
|
"username":self.username,
|
||||||
"access_token":self.access_token,
|
"accessToken":self.access_token,
|
||||||
"client_token":self.client_token,
|
"clientToken":self.client_token,
|
||||||
"profile": self.profile.dict(),
|
"selectedProfile": self.profile.dict(),
|
||||||
}
|
}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -58,7 +58,7 @@ class Token:
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls, data:dict):
|
def from_dict(cls, data:dict):
|
||||||
return cls(
|
return cls(
|
||||||
username=data["username"],
|
username=data["selectedProfile"]["name"],
|
||||||
access_token=data["accessToken"],
|
access_token=data["accessToken"],
|
||||||
client_token=data["clientToken"],
|
client_token=data["clientToken"],
|
||||||
profile=Profile(**data["selectedProfile"]),
|
profile=Profile(**data["selectedProfile"]),
|
||||||
|
|
Loading…
Reference in a new issue