Beispiel #1
0
        public async Task <IActionResult> Login(string email, string password)
        {
            DriversController _userManager = new DriversController(_context);

            if (!ModelState.IsValid)
            {
                return(View());
            }
            try
            {
                //authenticate
                var userdata = new Driver()
                {
                    dri_phone  = email,
                    dri_google = password
                };
                //var result = new User_AdminController(_context).SignIn(HttpContext, userdata);
                //RedirectToAction("../{User_AdminController}/SignIn", new { httpContext = this.HttpContext, user= userdata });
                await _userManager.SignIn(this.HttpContext, userdata);

                return(RedirectToAction("Index", "Order_Header", null));
            }
            catch (Exception ex)
            {
                return(RedirectToAction("Index", "Order_Header", null));
            }
        }