/// <summary> /// Used for initially Creating an anonymous account /// </summary> /// <param name="users_name">The display name of the user</param> /// <returns></returns> private IEnumerator Acquire_Anonymous_Tokens(string users_name) { YUR_Log.Log("Beginning to Login as an Anonymous User"); string response; yield return(response = Systems.Interops.User_AccountCreation.CreateAnonymousAccount()); if (response.StartsWith("--1")) { Bad_Login?.Invoke(response); yield break; } YUR_Log.Log("Successfully authenticated, begin retrieving data!"); yield return(CurrentUser.loginCredentials = Utilities.YUR_Conversions.ConvertStringToObject <LoginCredentials> (response)); YUR_Log.Log("Test"); YUR_Log.Log("ActiveUserAccount : " + CurrentUser.loginCredentials.RefreshToken); yield return(StartCoroutine(Get_UserData())); yield return(YUR_Main.main.User_Manager.CurrentUser.Data_Biometrics.Name = users_name); yield return(YUR_CurrentUser.Store_RefreshToken(CurrentUser.Data_Biometrics.Name, CurrentUser.Profile.PhotoURL, CurrentUser.loginCredentials.RefreshToken)); Successful_Login?.Invoke("Successfull Login!"); yield break; }
/// <summary> /// Used for initial login. Gets required login and persitence tokens /// </summary> /// <param name="email"></param> /// <param name="password"></param> /// <returns></returns> private IEnumerator Acquire_Access_Tokens(string email, string password) { YUR_Log.Log("Logging in with Email and Password"); string response; yield return(response = Systems.Interops.User_AccountAuthorization.Login_User(email, password)); YUR_Log.Log("Received data from Native DLL: " + response); if (response.StartsWith("--1")) { string error = "Login Credentials are invalid"; if (response.Contains("EMAIL_NOT_FOUND")) { error = "Email does not exist, try again"; } Bad_Login?.Invoke(error); yield break; } YUR_Log.Log("Successfully authenticated, begin retrieving data!"); YUR_Log.Server_Log("Received Data: " + response); yield return(CurrentUser.loginCredentials = Utilities.YUR_Conversions.ConvertStringToObject <LoginCredentials>(response)); YUR_Log.Log("Test"); YUR_Log.Log("ActiveUserAccount : " + CurrentUser.loginCredentials.RefreshToken); yield return(StartCoroutine(Get_UserData())); YUR_Log.Log("ActiveUserAccount Refresh Token: " + CurrentUser.loginCredentials.RefreshToken); YUR_Log.Log("ActiveUser PhotoURL: " + CurrentUser.Profile.PhotoURL); YUR_Log.Log("ActiveUserAccount DisplayName: " + CurrentUser.loginCredentials.DisplayName); yield return(YUR_CurrentUser.Store_RefreshToken(CurrentUser.loginCredentials.DisplayName, CurrentUser.Profile.PhotoURL, CurrentUser.loginCredentials.RefreshToken)); Successful_Login?.Invoke("Successfull Login!"); yield break; }