curl --request POST \
--url https://api.royalti.io/auth/logout \
--header 'Authorization: Bearer <token>'{
"message": "Logout successful"
}/auth/logout
curl --request POST \
--url https://api.royalti.io/auth/logout \
--header 'Authorization: Bearer <token>'{
"message": "Logout successful"
}/auth/logout endpoint allows users to log out and invalidate their access token, thereby revoking access to protected resources.
Method:POST
Response:const response = await fetch('https://api.royalti.io/auth/logout', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({})
});
const data = await response.json();
console.log(data);