示例#1
0
        private bool HasPassword()
        {
            var user = UserManager_.FindById(User.Identity.GetUserId());

            if (user != null)
            {
                return(user.PasswordHash != null);
            }
            return(false);
        }
示例#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);
        }