public async Task ReauthenticateAsync(IAuthCredential credential) { try { await _user.ReauthenticateAsync(credential.ToNative()).ConfigureAwait(false); } catch (FirebaseException e) { throw ExceptionMapper.Map(e); } }
// 사용자 재인증 private void ReAuth() { user = AuthManager.firebaseAuth.CurrentUser; Credential credential = EmailAuthProvider.GetCredential(user.Email, currentPW); if (user != null) { user.ReauthenticateAsync(credential).ContinueWith(task => { if (task.IsCanceled) { Debug.LogError("ReauthenticateAsync was canceled."); return; } if (task.IsFaulted) { Debug.LogError("ReauthenticateAsync encountered an error: " + task.Exception); return; } Debug.Log("Successfully reauthenticated."); IsSuccessOnReAuth = true; }); } }
// 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); } })); }