• Nomi

    (@naumanahmed19)


    Hi,
    I want to update the user and I have created a custom route. I have enabled jwt header in the plugin and sending a valid Bearer token in the header.

    What I am hoping to get $current_user if there is a token in the header. But I am getting an empty object as it seems not loggedin and is_user_logged_in() returns false.

    I am also providing valid auth key and enabled “All WordPress endpoints checks for JWT authentication” option

    	register_rest_route( 'wl/v1', 'user/update', array(
    		'methods' => 'POST',
    		'callback' => function ($request){
    			global $current_user;
    			return is_user_logged_in() ;
    		},
    	
    	) );
    
Viewing 1 replies (of 1 total)
  • Thread Starter Nomi

    (@naumanahmed19)

    can you please help me with this issue

Viewing 1 replies (of 1 total)
  • The topic ‘Get logged in user by Jwt token’ is closed to new replies.