Auth0_user_login hook on wordpress missing user metadata

Hi.

I am trying to integrate my Wordpress site with auth0.
I added auth0 official plugin, configured it and I added auth0_user_login hook in my functions.php file on the following way:

function auth0_docs_hook_auth0_user_login( $user_id, $userinfo, $is_new, $id_token, $access_token, $refresh_token ) {
	echo '<strong>WP user ID</strong>:<br>' . $user_id . '<hr>';
	echo '<strong>Auth0 user info</strong>:<br><pre>' . print_r( $userinfo, true ) . '</pre><hr>';
	echo '<strong>Added to WP DB?</strong>:<br>' . ( $is_new ? 'yep' : 'nope' ) . '<hr>';
	echo '<strong>ID Token</strong>:<br>' . ( $id_token ? $id_token : 'not provided' ) . '<hr>';
	echo '<strong>Access Token</strong>:<br>' . ( $access_token ? $access_token : 'not provided' ) . '<hr>';
	echo '<strong>Refresh Token</strong>:<br>' . ( $refresh_token ? $refresh_token : 'not provided' ) . '<hr>';
	wp_die( 'Login successful! <a href="' . home_url() . '">Home</a>' );
}
add_action( 'auth0_user_login', 'auth0_docs_hook_auth0_user_login', 10, 6 );

I added app_metadata info to my user and that info is visible from auth0 admin panel.
However, after login, $userInfo object inside the hook I pasted above, does not contain neither user_metadata nor app_metadata objects.

Why is that?

Thank you for the help.

Hey there!

As this topic is related to Rules - Hooks - Actions and Rules & Hooks are being deprecated soon I’m excited to let you know about our next Ask me Anything session in the Forum on Thursday, January 18 with the Rules, Hooks and Actions team on Rules & Hooks and why Actions matter! Submit your questions in the thread above and our esteemed product experts will provide written answers on January 18. Find out more about Rules & Hooks and why Actions matter! Can’t wait to see you there!

Learn more here!