Exemplo n.º 1
0
        public async Task <IActionResult> Register(RegisterViewModel model)
        {
            if (!ModelState.IsValid)
            {
                throw new Exception("Invalid registration information.");
            }

            var user = await register.RegisterUser(model);

            await login.LogInUserAsync(user, HttpContext);

            return(RedirectToAction(nameof(HomeController.Index), "Home"));
        }
Exemplo n.º 2
0
        public async Task <RegistrationResult> Register(string name, string email, string password, string confirm_password, Provider pr)
        {
            var results = await _register.RegisterUser(name, email, password, confirm_password, pr);

            return(results);
        }