-
-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception in json post! #427
Comments
I found the cause of the problem, I had to modify the buildUserFromRequest method in the /src/Authentication/Passwords/ValidationRules.php file
Is this modification acceptable? |
so it should be better! |
I think that is likely fine. If you can submit a PR for it, that would be awesome. |
Hi, no news about adding this issue to the release? |
If someone wants to take this on as a PR please do. |
I'll do |
Maybe just like this? protected function buildUserFromRequest()
{
$fields = $this->prepareValidFields();
// $data = array_filter(service('request')->getPost($fields));
// pulling data from $_REQUEST, get rid of NULL values
// works fine with both 'form-multipart' and 'application/json' content-types
// return type is array
$data = array_filter(service('request')->getVar($fields));
return new User($data);
} |
And what about Shield? Shield's code is same as Myth. |
Hi, i implemented myth auth in a test api and when i try to create a new user via "application/json" i get an exception
When I send the request through "multipart/form-data" I get the registration successfully!
I investigated the myth files to find a solution to this problem, but I couldn't.
Below are the classes I used as a test:
Routes:
$routes->resource('api/v1/users');
Prints:
Codeigniter 4.1.3
PHP 7.3
The text was updated successfully, but these errors were encountered: