Beispiel #1
0
        private Notification ValidateAuthentication(IdentityUser identityUser, string loginUserName,
                                                    string loginPassword)
        {
            Notification notification = new Notification();

            if (identityUser == null)
            {
                notification.AddError("Your account doesn't exists");
                return(notification);
            }

            if (!identityUser.HasValidCredentials(loginUserName, loginPassword))
            {
                notification.AddError("Your credentials are not correct");
                return(notification);
            }

            if (!identityUser.Active)
            {
                notification.AddError("Your account is not actived, please reach out the web master.");
                return(notification);
            }

            return(notification);
        }