From 09f17386eb46a0b9f94fe07106beea44f41e8ce8 Mon Sep 17 00:00:00 2001 From: chaitanyapotti Date: Thu, 26 Oct 2023 17:28:58 +0800 Subject: [PATCH] fix logout --- Assets/Plugins/Web3AuthSDK/Api/Web3AuthApi.cs | 9 +++++++++ Assets/Plugins/Web3AuthSDK/Web3Auth.cs | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Assets/Plugins/Web3AuthSDK/Api/Web3AuthApi.cs b/Assets/Plugins/Web3AuthSDK/Api/Web3AuthApi.cs index 5371410..aaf4afe 100644 --- a/Assets/Plugins/Web3AuthSDK/Api/Web3AuthApi.cs +++ b/Assets/Plugins/Web3AuthSDK/Api/Web3AuthApi.cs @@ -56,6 +56,15 @@ public IEnumerator logout(LogoutApiRequest logoutApiRequest, Action cal var request = UnityWebRequest.Post($"{baseAddress}/store/set", data); yield return request.SendWebRequest(); + // Debug.Log("baseAddress =>" + baseAddress); + // Debug.Log("key =>" + logoutApiRequest.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; diff --git a/Assets/Plugins/Web3AuthSDK/Web3Auth.cs b/Assets/Plugins/Web3AuthSDK/Web3Auth.cs index fae5ef6..ffa71b0 100644 --- a/Assets/Plugins/Web3AuthSDK/Web3Auth.cs +++ b/Assets/Plugins/Web3AuthSDK/Web3Auth.cs @@ -463,7 +463,8 @@ private void sessionTimeOutAPI() try { KeyStoreManagerUtils.deletePreferencesData(KeyStoreManagerUtils.SESSION_ID); - KeyStoreManagerUtils.deletePreferencesData(web3AuthOptions.loginConfig?.Values.First()?.verifier); + if (web3AuthOptions.loginConfig != null) + KeyStoreManagerUtils.deletePreferencesData(web3AuthOptions.loginConfig?.Values.First()?.verifier); this.Enqueue(() => this.onLogout?.Invoke()); }