We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please answer the following questions for yourself before submitting an issue.
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
I'm not a PHP specialist, so i'm just trying to extend code I fond on stackoverflow
I have
add_action( 'jwt_auth_token_before_sign', 'jwt_token', 10, 2 ); function jwt_token($token, $user) { $data = [ 'user' => [ 'id' => $user->data->ID, 'name' => $user->data->display_name, 'roles' => implode(',', $user->roles) ] ]; $token['data'] = $data; return $token; }
the trouble is that when this returns after an auth request I get
Array{ "token": "eyJ0e...NcbMJcQ", "user_email": "[email protected]", "user_nicename": "xyz", "user_display_name": "xyz" }
the word Array is then messing up the parsing in the client
Array
Any ideas how to return a $token that continues to json encode properly?
$token
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issue Name
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Expected Behavior
I'm not a PHP specialist, so i'm just trying to extend code I fond on stackoverflow
I have
the trouble is that when this returns after an auth request I get
the word
Array
is then messing up the parsing in the clientAny ideas how to return a
$token
that continues to json encode properly?The text was updated successfully, but these errors were encountered: