Logout endpoint
-
I’d like to propose a logout endpoint that calls wp_logout() to remove any cookies.
I’m using something basic like..
add_action( 'rest_api_init', function () { register_rest_route( 'custom', 'v1/logout', array( 'methods' => 'GET', 'callback' => 'custom_logout', ) ); } ); function custom_logout() { return wp_logout(); }
Not sure if i’m missing or anything but yeah not calling wp_logout() was causing a lot of problems for my frontend.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Logout endpoint’ is closed to new replies.