Skip to content
This repository was archived by the owner on Aug 18, 2024. It is now read-only.

Commit 2c1fd0a

Browse files
committed
Added .Net Standard 2.1 support
1 parent fc2875b commit 2c1fd0a

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

.idea/.idea.unity-appwrite-plugin/.idea/workspace.xml

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Plugins/Lowscope/Appwrite/Runtime/Accounts/Account.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ private async UniTask<bool> RefreshUserInfo()
6060

6161
if (httpStatusCode == HttpStatusCode.OK)
6262
{
63-
dynamic parsedData = JObject.Parse(json);
64-
user.Name = parsedData.name;
65-
user.EmailVerified = parsedData.emailVerification;
63+
JObject parsedData = JObject.Parse(json);
64+
user.Name = (string)parsedData.GetValue("name");
65+
user.EmailVerified = (bool)parsedData.GetValue("emailVerification");
6666
StoreUserToDisk();
6767
}
6868
else
@@ -116,13 +116,13 @@ or HttpStatusCode.InternalServerError
116116
return (null, ELoginResponse.ServerBusy);
117117
}
118118
}
119-
120-
dynamic parsedData = JObject.Parse(json);
119+
120+
JObject parsedData = JObject.Parse(json);
121121

122122
user = new User
123123
{
124-
Id = parsedData.userId,
125-
Email = parsedData.providerUid,
124+
Id = (string)parsedData.GetValue("userId"),
125+
Email = (string)parsedData.GetValue("providerUid"),
126126
Cookie = request.ExtractCookie()
127127
};
128128

@@ -139,7 +139,7 @@ or HttpStatusCode.InternalServerError
139139
{
140140
if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(name) || string.IsNullOrEmpty(email))
141141
return (null, ERegisterResponse.MissingCredentials);
142-
142+
143143
if (user != null)
144144
return (user, ERegisterResponse.AlreadyLoggedIn);
145145

@@ -214,15 +214,15 @@ public async UniTask<string> ObtainJwt(bool fromCache = true)
214214
if (httpStatusCode != HttpStatusCode.Created)
215215
return "";
216216

217-
dynamic parsedData = JObject.Parse(json);
217+
JObject parsedData = JObject.Parse(json);
218218

219-
string jwt = parsedData.jwt;
219+
string jwt = (string)parsedData.GetValue("jwt");
220220
user.Jwt = jwt;
221221

222222
// Remove minute to account for latency.
223223
user.JwtProvideDate = DateTime.Now - TimeSpan.FromMinutes(1);
224224

225-
return parsedData.jwt;
225+
return jwt;
226226
}
227227

228228
public async UniTask<EEmailVerifyResponse> RequestVerificationMail()

0 commit comments

Comments
 (0)