Feature Request: get_current_user_id
-
I encountered heaps of issues with getting the current user if they’re logged in using JWT. With some help from someone else on here I use this solution.
Maybe you could incorporate a similar function into the plugin.
e.g.
function get_current_user_id() { if (class_exists('Jwt_Auth_Public')) { $jwt = new \Jwt_Auth_Public('jwt-auth', '1.1.0'); $token = $jwt->validate_token(false); if (\is_wp_error($token)) { return false; } return $token->data->user->id; } else { return false; } }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Feature Request: get_current_user_id’ is closed to new replies.