public ActionResult RegisterAPI(RegisterDto registerRequest)
        {
            registerRequest = SanitizeRegisterDto.Sanitize(registerRequest);
            if (registerRequest.Errored)
            {
                return(BadRequest(registerRequest.ErrorMessages));
            }
            //Register in service
            var RegistrationService = new Signup();

            RegistrationService.SignupAccountAndUser(registerRequest);
            if (RegistrationService.Errored)
            {
                return(BadRequest(RegistrationService.ErrorMessages));
            }

            //Authenticate and retrieve token
            var authenticator = new Authenticater();

            authenticator.AuthenticateSignin(registerRequest.Password, registerRequest.Email);
            if (authenticator.Errored)
            {
                return(BadRequest(authenticator.ErrorMessages));
            }

            return(Ok(authenticator.Token));
        }
        public ActionResult SigninAPI(SigninDto signinRequest)
        {
            signinRequest = SanitizeSigninDto.Sanitize(signinRequest);
            if (signinRequest.Errored)
            {
                return(BadRequest(signinRequest.ErrorMessages));
            }
            //Authenticate and retrieve token
            var authenticator = new Authenticater();

            authenticator.AuthenticateSignin(signinRequest.Password, signinRequest.Email);
            if (authenticator.Errored)
            {
                return(BadRequest(authenticator.ErrorMessages));
            }
            return(Ok(authenticator.Token));
        }