Ejemplo n.º 1
0
        public IActionResult Register(RegisterForm registerForm)
        {
            if (!(registerForm is null) && ModelState.IsValid)
            {
                //_logger.LogInformation($"{registerForm.Passwd}");
                registerForm.Passwd = _cryptoService.Decrypter(Convert.FromBase64String(registerForm.Passwd));
                //_logger.LogInformation($"{registerForm.Passwd}");

                try
                {
                    _authRepository.Register(registerForm);
                    return(Ok());
                }
                catch (Exception ex)
                {
                    return(BadRequest());
                }
            }

            return((!(registerForm is null)) ? BadRequest(ModelState) : BadRequest("There is no Data !"));
        }