Skip to content
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

Passing user_meta in POST body doesn't work #28

Closed
Weeb opened this issue Feb 18, 2022 · 1 comment · Fixed by #33
Closed

Passing user_meta in POST body doesn't work #28

Weeb opened this issue Feb 18, 2022 · 1 comment · Fixed by #33

Comments

@Weeb
Copy link

Weeb commented Feb 18, 2022

First of all, thanks for a great plugin!

Bug Description

Passing "user_meta" in POST body as JSON doesn't work, for example:

"user_meta": {
"billing_first_name": "Billy-Bob",
"billing_last_name": "Thornton"
}

However it works if passing it as a string via URL parameter, which can get quite messy if dealing with more meta.

I've managed to fix it by directly editing RegisterUserService.php (around line 77) and checking if
$this->request['user_meta'] is an array before running json_decode.

Environment

Question Answer
PHP version 7.4.10
WordPress version 5.9
Simple-JWT-Login plugin version 3.4.2

Additional Context (optional)

image

@Lupul
Copy link
Contributor

Lupul commented Apr 24, 2022

I was able to reproduce this issue too, json in body is already decoded in ParseRequest.php:L51

$variables = json_decode($content, true);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants