Пример #1
0
        void DrawRemoveTwoFactorAuthView()
        {
            GUILayout.BeginArea(ContentSection);

            EditorGUILayout.BeginVertical();

            EditorGUILayout.BeginHorizontal();

            EditorGUILayout.LabelField("To remove Two-Factor Authentication, Please enter a secret key from your Google Authenticator and click Remove");

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();

            remove2FASecret = EditorGUILayout.IntField(remove2FASecret);

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();

            if (GUILayout.Button("Remove", GUILayout.Height(20)))
            {
                currentView = LootLockerView.Loading;
                LootLockerSDKAdminManager.RemoveTwoFactorAuthentication(remove2FASecret, (response) =>
                {
                    if (response.success)
                    {
                        Debug.Log("Successful removed 2fa: " + response.text);
                        mfaState    = false;
                        currentView = LootLockerView.Games;
                    }
                    else
                    {
                        currentView = LootLockerView.Remove2FAConfirm;
                        Debug.LogError("failed to get admin auth response: " + response.Error);
                    }
                });
            }

            EditorGUILayout.EndHorizontal();

            if (GUILayout.Button("Back", GUILayout.Height(20)))
            {
                currentView = LootLockerView.Login;
            }

            EditorGUILayout.EndVertical();

            GUILayout.EndArea();
        }