public async Task <IActionResult> Login(Login model)
        {
            Login  user = _userData.DoAdminLogin(model.UserName, model.Password);
            string rUrl = HttpContext.Request.Path;
            string Role = "Admin";

            rUrl = Url.ToString();

            if (user.UserName != "" && user.UType == UserType.Admin)
            {
                var claims = new List <Claim>
                {
                    new Claim(ClaimTypes.Name, user.UserName),
                    new Claim(ClaimTypes.Sid, user.UserId.ToString()),
                    new Claim(ClaimTypes.Role, Role)
                };

                var userIdentity = new ClaimsIdentity(claims, "login");

                ClaimsPrincipal principal = new ClaimsPrincipal(userIdentity);

                //await HttpContext.Authentication.SignInAsync("CookieAuthentication", principal);
                await HttpContext.SignInAsync(principal);

                return(RedirectToAction("Index", "Admin"));
            }

            return(View());
        }