Esempio 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"));
        }
Esempio 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);
        }