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

bug: Meta data does not save in create use endpoint #86

Closed
diegoanvilla opened this issue Oct 6, 2023 · 3 comments
Closed

bug: Meta data does not save in create use endpoint #86

diegoanvilla opened this issue Oct 6, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@diegoanvilla
Copy link

Bug Report

Plugin Version

3.5.1

Bug description

When using the create user endpoint and adding the user_meta param the user is created but no meta user entry is creaed with the values provided

Additional Context (optional)

Endoint example:
https://example.com/?rest_route=/simple-jwt-login/v1/users&email=test@test.com&user_login=test&AUTH_KEY=test&user_meta={"test":"test"}

@diegoanvilla diegoanvilla added the bug Something isn't working label Oct 6, 2023
@nicumicle
Copy link
Owner

Hi @diegoanvilla,

Thank you for reporting this bug.
I've investigated this, and indeed, it seems to be an issue.

I'm working on a fix and come back with updates.

Best regards,
Nicu.

@nicumicle
Copy link
Owner

Hi @diegoanvilla ,
The issue should be fixed now.

Can you please download the plugin from https://github.com/nicumicle/simple-jwt-login/blob/master/download/simple-jwt-login.zip and check on your side if all works ok?

I recommend sending the request for register users in the body of the request with the Content-Type: application/json header.

image

curl --location 'http://localhost:88/?rest_route=%2Fsimple-jwt-login%2Fv1%2Fusers' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "email@example.com",
    "password": "password",
    "user_meta": {
        "wp_user_level" : 123
    }
}'

PS: Please make sure you set the "Allowed user_meta keys on create user" in the Register user settings with the meta keys that you intend to use.
image

@diegoanvilla
Copy link
Author

Hi, yes the issue has been solved, thank you for the assistance :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants