Implement Log out button

You can log users out through the Discourse API by making an authenticated POST request to /admin/users/<user_id>/log_out. You need to replace <user_id> with the user’s Discourse user ID.

You can see this implemented in the Discourse WordPress plugin here: wp-discourse/lib/sso-provider/discourse-sso.php at main · discourse/wp-discourse · GitHub