Skip to content

Commit 7da9951

Browse files
committed
code refactored
Signed-off-by: Gaurav Goel <[email protected]>
1 parent 1c1e0a4 commit 7da9951

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Assets/Plugins/Web3AuthSDK/Web3Auth.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public void setResultUrl(Uri uri)
285285
this.Enqueue(() => KeyStoreManagerUtils.savePreferenceData(KeyStoreManagerUtils.SESSION_ID, sessionId));
286286

287287
//call authorize session API
288-
authorizeSession(sessionId);
288+
this.Enqueue(() => authorizeSession(sessionId));
289289

290290
#if !UNITY_EDITOR && UNITY_WEBGL
291291
if (this.web3AuthResponse != null)
@@ -336,11 +336,10 @@ private void authorizeSession(string newSessionId)
336336
} else {
337337
sessionId = newSessionId;
338338
}
339-
Debug.Log("sessionId from KeyStoreManager: " + sessionId);
339+
340340
if (!string.IsNullOrEmpty(sessionId))
341341
{
342342
var pubKey = KeyStoreManagerUtils.getPubKey(sessionId);
343-
Debug.Log("pubKey: " + pubKey);
344343
StartCoroutine(Web3AuthApi.getInstance().authorizeSession(pubKey, (response =>
345344
{
346345
if (response != null)
@@ -358,7 +357,6 @@ private void authorizeSession(string newSessionId)
358357
var tempJson = JsonConvert.DeserializeObject<JObject>(System.Text.Encoding.UTF8.GetString(share));
359358

360359
this.web3AuthResponse = JsonConvert.DeserializeObject<Web3AuthResponse>(tempJson.ToString());
361-
Debug.Log("authorizeSessionRespnse : " + this.web3AuthResponse);
362360
if (this.web3AuthResponse != null)
363361
{
364362
if (this.web3AuthResponse.error != null)
@@ -370,7 +368,6 @@ private void authorizeSession(string newSessionId)
370368
KeyStoreManagerUtils.savePreferenceData(KeyStoreManagerUtils.SESSION_ID, this.web3AuthResponse.sessionId);
371369
}
372370

373-
374371
if (!string.IsNullOrEmpty(web3AuthResponse.userInfo?.dappShare))
375372
{
376373
KeyStoreManagerUtils.savePreferenceData(

0 commit comments

Comments
 (0)