Esempio n. 1
0
        public async Task <IAuthResult> ResolveSignInAsync(IMultiFactorAssertion multiFactorAssertion)
        {
            try
            {
                var result = await _multiFactorResolver.ResolveSignIn(multiFactorAssertion.ToNative())
                             .AsAsync <Firebase.Auth.IAuthResult>()
                             .ConfigureAwait(false);

                return(new AuthResultWrapper(result));
            }
            catch (FirebaseException e)
            {
                throw ExceptionMapper.Map(e);
            }
        }
Esempio n. 2
0
        public Task <IAuthResult> ResolveSignInAsync(IMultiFactorAssertion multiFactorAssertion)
        {
            var tcs = new TaskCompletionSource <IAuthResult>();

            _multiFactorResolver.ResolveSignIn(multiFactorAssertion.ToNative(), (authResult, error) =>
            {
                if (error != null)
                {
                    tcs.SetException(ExceptionMapper.Map(error));
                }
                else
                {
                    tcs.SetResult(new AuthResultWrapper(authResult));
                }
            });

            return(tcs.Task);
        }