Пример #1
0
        private void onAuthRequest(System.Threading.Tasks.Task <FirebaseUser> task)
        {
            if (task.IsCanceled)
            {
                Debug.LogError("Creating new account was cancelled...");
                return;
            }

            if (task.IsFaulted)
            {
                foreach (var innerException in task.Exception.InnerExceptions)
                {
                    handleAuthException(innerException as FirebaseException);
                }

                return;
            }
            //currentUser = task.Result;
            Debug.Log("AuthController, Auth success:: \n" + currentUser.ToString());
            //OnAuthenticationSuccess(currentUser, newUserRegistration);
        }
Пример #2
0
        private void onAuthenticationStateChanged(object sender, EventArgs e)
        {
            if (auth.CurrentUser != currentUser)
            {
                bool signedIn = currentUser != auth.CurrentUser && auth.CurrentUser != null;
                if (!signedIn && currentUser != null)
                {
                    Debug.Log(TAG + ":: Signed out " + currentUser.UserId);
                }

                currentUser = auth.CurrentUser;
                if (signedIn)
                {
                    Debug.Log(TAG + ":: Signed in " + currentUser.UserId);


                    Debug.Log(TAG + ":: The user's already authenticated ... :: \n" + currentUser.ToString());
                    OnAuthenticationSuccess(currentUser, newUserRegistration);


                    //displayName = currentUser.DisplayName ?? "";
                    //emailAddress = currentUser.Email ?? "";
                    //photoUrl = currentUser.PhotoUrl ?? "";
                }
            }
        }