Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Profile data not returned in get_auth0userinfo() #236

Closed
terryw707 opened this issue Sep 5, 2016 · 2 comments
Closed

Profile data not returned in get_auth0userinfo() #236

terryw707 opened this issue Sep 5, 2016 · 2 comments

Comments

@terryw707
Copy link

It appears that wp_get_current_user() returns a WP_User object which is then passed to get_auth0userinfo() expecting an integer user_id. This causes the get_user_meta call to fail to return $profile data. https://github.com/auth0/wp-auth0/blob/master/WP_Auth0.php#L376

if ( ! function_exists( 'get_auth0userinfo' ) ) {
    function get_auth0userinfo( $user_id ) {
        global $wpdb;
        $profile = get_user_meta( $user_id, $wpdb->prefix.'auth0_obj', true);
        if ($profile) {
            return WP_Auth0_Serializer::unserialize( $profile );
        }
        return false;
    }
}
if ( ! function_exists( 'get_currentauth0userinfo' ) ) {
    function get_currentauth0userinfo() {
        global $currentauth0_user;
        $current_user = wp_get_current_user();
        $currentauth0_user = get_auth0userinfo($current_user);

        return $currentauth0_user;
    }
}

@glena
Copy link
Contributor

glena commented Sep 5, 2016

Yes it is fixed on dev. The fix will be released by EOW

@glena
Copy link
Contributor

glena commented Sep 7, 2016

I will release 3.2.5 in a couple of hours. I am closing this one but reopen after the update if you need.

@glena glena closed this as completed Sep 7, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants