curl --request PUT \
--url https://{tenant}.fincode.software/api/v6/services/securitymanagement/logout \
--header 'Content-Type: application/json' \
--header 'platform: <platform>' \
--header 'uuid: <uuid>' \
--data '
{
"refresh_token": "<string>"
}
'Invalidate the current user session by revoking the refresh token and access token.
curl --request PUT \
--url https://{tenant}.fincode.software/api/v6/services/securitymanagement/logout \
--header 'Content-Type: application/json' \
--header 'platform: <platform>' \
--header 'uuid: <uuid>' \
--data '
{
"refresh_token": "<string>"
}
'application/jsonfincode200const axios = require("axios");
async function logout(refreshToken) {
try {
const response = await axios.put(
"[https://remitjunction.fincode.software/api/v6/services/securitymanagement/logout](https://remitjunction.fincode.software/api/v6/services/securitymanagement/logout)",
{
refresh_token: refreshToken,
},
{
headers: {
"Content-Type": "application/json",
platform: "fincode",
uuid: "200",
},
}
);
console.log("Logout successful:", response.data.message);
return response.data;
} catch (error) {
console.error("Logout failed:", error.response?.data || error.message);
throw error;
}
}
// Example Usage
const currentRefreshToken = "eyJhbGciOiJ...";
logout(currentRefreshToken);