Beispiel #1
0
        public IActionResult Registration([FromBody] RegistrationModel registrationModel)
        {
            User user;

            try
            {
                user = authService.Registration(registrationModel.Login,
                                                registrationModel.Password, registrationModel.Email,
                                                (DataBaseModels.State.Users.UserRole)registrationModel.Role);
                emailConfirmationService.SendСonfirmation(user);
            }
            catch (AuthenticationServiceException ex) {
                return(BadRequest(ex.Message));
            }
            return(new JsonResult(user.Login));
        }