Пример #1
0
        public async Task <IAuthResult> ReauthenticateAndRetrieveDataAsync(IAuthCredential credential)
        {
            try
            {
                var result = await _user.ReauthenticateAndRetrieveDataAsync(credential.ToNative()).ConfigureAwait(false);

                return(new AuthResultWrapper(result));
            }
            catch (FirebaseException e)
            {
                throw ExceptionMapper.Map(e);
            }
        }
Пример #2
0
        // Reauthenticate the user with the current email / password.
        protected Task ReauthenticateAsync()
        {
            FirebaseUser user = auth.CurrentUser;

            if (user == null)
            {
                DebugLog("Not signed in, unable to reauthenticate user.");
                TaskCompletionSource <bool> tcs = new TaskCompletionSource <bool>();
                tcs.SetException(new Exception("Not signed in"));
                return(tcs.Task);
            }

            DebugLog("Reauthenticating...");
            DisableUI();
            Credential cred = EmailAuthProvider.GetCredential(email, password);

            if (signInAndFetchProfile)
            {
                return(user.ReauthenticateAndRetrieveDataAsync(cred).ContinueWith(task =>
                {
                    EnableUI();
                    if (LogTaskCompletion(task, "Reauthentication"))
                    {
                        DisplaySignInResult(task.Result, 1);
                    }
                }));
            }
            return(user.ReauthenticateAsync(cred).ContinueWith(task =>
            {
                EnableUI();
                if (LogTaskCompletion(task, "Reauthentication"))
                {
                    DisplayDetailedUserInfo(auth.CurrentUser, 1);
                }
            }));
        }