Esempio n. 1
0
 /// <summary>
 /// Blockes users registerd with facebook.
 /// </summary>
 /// <param name="registrationKey"></param>
 /// <returns></returns>
 private async Task BlockFacebookAuth(string registrationKey)
 {
     try
     {
         FacebookAuthModel facebookAuth = _facebookAuthRepository.GetAuthByFacebookId(registrationKey);
         facebookAuth.IsBLocked = true;
         await _facebookAuthRepository.Update(facebookAuth);
     }
     catch (Exception)
     {
         throw;
     }
 }
 private async Task <string> FacebookLogin(string facebookId)
 {
     try
     {
         var facebookAuth = _facebookAuthRepository.GetAuthByFacebookId(facebookId);
         if (!facebookAuth.IsBLocked)
         {
             return(await _loginTokenManager.Add(facebookAuth.UserId, LoginTokenModel.LoginTypes.Facebook));
         }
         else
         {
             throw new UserBlockedException("user is blocked");
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }