public static void TwoFactorAuthVerification(LootLockerTwoFactorAuthVerficationRequest data, Action <LootLockerAuthResponse> onComplete) { string json = ""; if (data == null) { return; } else { json = JsonConvert.SerializeObject(data); } EndPointClass endPoint = LootLockerEndPoints.current.twoFactorAuthenticationCodeVerification; LootLockerServerRequest.CallAPI(endPoint.endPoint, endPoint.httpMethod, json, (serverResponse) => { var response = new LootLockerAuthResponse(); if (string.IsNullOrEmpty(serverResponse.Error)) { response = JsonConvert.DeserializeObject <LootLockerAuthResponse>(serverResponse.text); response.text = serverResponse.text; LootLockerConfig.current.UpdateToken(response.auth_token); onComplete?.Invoke(response); } else { response.message = serverResponse.message; response.Error = serverResponse.Error; onComplete?.Invoke(response); } }, useAuthToken: false, callerRole: LootLocker.LootLockerEnums.LootLockerCallerRole.Admin); }
/// <summary> /// This is also an admin call, please do not use this for the normal game /// </summary> /// <param name="mfa_key"></param> /// <param name="secret"></param> /// <param name="onComplete"></param> public static void TwoFactorAuthVerification(string mfa_key, string secret, Action <LootLockerAuthResponse> onComplete) { if (!CheckInitialized()) { return; } var data = new LootLockerTwoFactorAuthVerficationRequest(); data.mfa_key = mfa_key; data.secret = secret; DemoAppAdminRequests.TwoFactorAuthVerification(data, onComplete); }