diff --git a/Assets/Plugins/Web3AuthSDK/Api/Web3AuthApi.cs b/Assets/Plugins/Web3AuthSDK/Api/Web3AuthApi.cs index e83586c..5371410 100644 --- a/Assets/Plugins/Web3AuthSDK/Api/Web3AuthApi.cs +++ b/Assets/Plugins/Web3AuthSDK/Api/Web3AuthApi.cs @@ -23,18 +23,18 @@ public IEnumerator authorizeSession(string key, Action callbac //var request = UnityWebRequest.Get(requestURL); WWWForm data = new WWWForm(); data.AddField("key", key); - + var request = UnityWebRequest.Post($"{baseAddress}/store/get", data); yield return request.SendWebRequest(); - Debug.Log("baseAddress =>" + baseAddress); - Debug.Log("key =>" + key); - //Debug.Log("request URL =>"+ requestURL); - Debug.Log("request.isNetworkError =>" + request.isNetworkError); - Debug.Log("request.isHttpError =>" + request.isHttpError); - Debug.Log("request.isHttpError =>" + request.error); - Debug.Log("request.result =>" + request.result); - Debug.Log("request.downloadHandler.text =>" + request.downloadHandler.text); + // Debug.Log("baseAddress =>" + baseAddress); + // Debug.Log("key =>" + key); + // //Debug.Log("request URL =>"+ requestURL); + // Debug.Log("request.isNetworkError =>" + request.isNetworkError); + // Debug.Log("request.isHttpError =>" + request.isHttpError); + // Debug.Log("request.isHttpError =>" + request.error); + // Debug.Log("request.result =>" + request.result); + // Debug.Log("request.downloadHandler.text =>" + request.downloadHandler.text); if (request.result == UnityWebRequest.Result.Success) { string result = request.downloadHandler.text; @@ -51,7 +51,7 @@ public IEnumerator logout(LogoutApiRequest logoutApiRequest, Action cal data.AddField("data", logoutApiRequest.data); data.AddField("signature", logoutApiRequest.signature); data.AddField("timeout", logoutApiRequest.timeout.ToString()); - Debug.Log("key during logout session =>" + logoutApiRequest.key); + // Debug.Log("key during logout session =>" + logoutApiRequest.key); var request = UnityWebRequest.Post($"{baseAddress}/store/set", data); yield return request.SendWebRequest(); @@ -66,22 +66,22 @@ public IEnumerator logout(LogoutApiRequest logoutApiRequest, Action cal } public IEnumerator createSession(LogoutApiRequest logoutApiRequest, Action callback) - { - WWWForm data = new WWWForm(); - data.AddField("key", logoutApiRequest.key); - data.AddField("data", logoutApiRequest.data); - data.AddField("signature", logoutApiRequest.signature); - data.AddField("timeout", logoutApiRequest.timeout.ToString()); - Debug.Log("key during create session =>" + logoutApiRequest.key); - var request = UnityWebRequest.Post($"{baseAddress}/store/set", data); - yield return request.SendWebRequest(); + { + WWWForm data = new WWWForm(); + data.AddField("key", logoutApiRequest.key); + data.AddField("data", logoutApiRequest.data); + data.AddField("signature", logoutApiRequest.signature); + data.AddField("timeout", logoutApiRequest.timeout.ToString()); + // Debug.Log("key during create session =>" + logoutApiRequest.key); + var request = UnityWebRequest.Post($"{baseAddress}/store/set", data); + yield return request.SendWebRequest(); - if (request.result == UnityWebRequest.Result.Success) - { - string result = request.downloadHandler.text; - callback(Newtonsoft.Json.JsonConvert.DeserializeObject(result)); - } - else - callback(null); + if (request.result == UnityWebRequest.Result.Success) + { + string result = request.downloadHandler.text; + callback(Newtonsoft.Json.JsonConvert.DeserializeObject(result)); } + else + callback(null); + } } diff --git a/Assets/Plugins/Web3AuthSDK/Web3Auth.cs b/Assets/Plugins/Web3AuthSDK/Web3Auth.cs index 1de475d..fae5ef6 100644 --- a/Assets/Plugins/Web3AuthSDK/Web3Auth.cs +++ b/Assets/Plugins/Web3AuthSDK/Web3Auth.cs @@ -310,7 +310,7 @@ public void setResultUrl(Uri uri) this.Enqueue(() => KeyStoreManagerUtils.savePreferenceData(KeyStoreManagerUtils.SESSION_ID, sessionId)); //call authorize session API - Debug.Log("publickey after successful redirection from web. =>" + sessionId); + // Debug.Log("publickey after successful redirection from web. =>" + sessionId); this.Enqueue(() => authorizeSession(sessionId)); #if !UNITY_EDITOR && UNITY_WEBGL @@ -360,17 +360,16 @@ private void authorizeSession(string newSessionId) if (string.IsNullOrEmpty(newSessionId)) { sessionId = KeyStoreManagerUtils.getPreferencesData(KeyStoreManagerUtils.SESSION_ID); - Debug.Log("sessionId during authorizeSession in if part =>" + sessionId); + // Debug.Log("sessionId during authorizeSession in if part =>" + sessionId); } else { sessionId = newSessionId; - Debug.Log("sessionId during authorizeSession in else part =>" + sessionId); + // Debug.Log("sessionId during authorizeSession in else part =>" + sessionId); } if (!string.IsNullOrEmpty(sessionId)) - { Debug.Log("sessionId during authorizeSession =>" + sessionId); - Debug.Log("public key during authorizeSession =>" + KeyStoreManagerUtils.getPubKey(sessionId)); + { var pubKey = KeyStoreManagerUtils.getPubKey(sessionId); StartCoroutine(Web3AuthApi.getInstance().authorizeSession(pubKey, (response => { @@ -484,7 +483,7 @@ private async Task createSession(string data, long sessionTime) { TaskCompletionSource createSessionResponse = new TaskCompletionSource(); var newSessionKey = KeyStoreManagerUtils.generateRandomSessionKey(); - Debug.Log("newSessionKey =>" + newSessionKey); + // Debug.Log("newSessionKey =>" + newSessionKey); var ephemKey = KeyStoreManagerUtils.getPubKey(newSessionKey); var ivKey = KeyStoreManagerUtils.generateRandomBytes(); @@ -518,7 +517,8 @@ private async Task createSession(string data, long sessionTime) if (result != null) { try - { Debug.Log("newSessionKey before saving into keystore =>" + newSessionKey); + { + // Debug.Log("newSessionKey before saving into keystore =>" + newSessionKey); this.Enqueue(() => KeyStoreManagerUtils.savePreferenceData(KeyStoreManagerUtils.SESSION_ID, newSessionKey)); createSessionResponse.SetResult(newSessionKey); }