Ejemplo n.º 1
0
        private bool HasPassword()
        {
            var user = UserManager_.FindById(User.Identity.GetUserId());

            if (user != null)
            {
                return(user.PasswordHash != null);
            }
            return(false);
        }
Ejemplo n.º 2
0
        private async Task SignInAsync(ApplicationUser user, bool isPersistent)
        {
            AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie);
            var identity = await UserManager_.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie);

            AuthenticationManager.SignIn(new AuthenticationProperties()
            {
                IsPersistent = isPersistent
            }, identity);
        }