Hi, I’m trying to redirect an user when login if is subscriber, I’m following the auth0 documentation but I can’t make it work
function auth0_docs_hook_authorize_url_params( array $params, $connection, $redirect_to ) {
global $user;
if ( isset( $user->roles ) && is_array( $user->roles ) ) {
if ( in_array( 'subscriber', $user->roles ) ) {
$params[ 'redirect_uri' ] = 'https://example.com/subscribers';
}
}
return $params;
}
add_filter( 'auth0_authorize_url_params', 'auth0_docs_hook_authorize_url_params', 10, 3 );
I don’t have idea how to do this someone have an idea? Thanks!