Пример #1
0
        public static ErrorHandle <string> HandleErrors(Microsoft.AspNetCore.Identity.SignInResult serrors)
        {
            var errorHandle = new ErrorHandle <string>();

            if (!serrors.Succeeded)
            {
                errorHandle.Add("LoginFailed");
            }

            if (serrors.RequiresTwoFactor)
            {
                errorHandle.Add("RequiresTwoFactor");
            }

            if (serrors.IsLockedOut)
            {
                errorHandle.Add("IsLockedOut");
            }

            if (serrors.IsNotAllowed)
            {
                errorHandle.Add("IsNotAllowed");
            }

            return(errorHandle);
        }
Пример #2
0
        public static ErrorHandle <string> HandleErrors(IEnumerable <IdentityError> ierrors)
        {
            var errorHandle = new ErrorHandle <string>();

            foreach (var error in ierrors)
            {
                errorHandle.Add(error.Code);
            }
            return(errorHandle);
        }