Reputation: 23
Can't seem to find anything that makes FusionAuth send a signal to applications to terminate a user's session upon signout.
Upvotes: 1
Views: 576
Reputation: 1690
FusionAuth provides an API at /api/logout
that might work. This API will revoke any refresh tokens that the user has. When refresh tokens are revoked, FusionAuth will send an event out to any configured Webhooks.
Here is the documentation on this API, Webhooks and the event that is fired:
Here are the rough steps you can take to get this working:
https://example.com/global-logout
)/api/logout
endpoint in FusionAuthjwt.refresh-token.revoke
eventYou can see an example Webhook in the documentation link about. A Webhook that handles the jwt.refresh-token.revoke
event might look like this in Node/JavaScript:
router.route('/fusionauth-webhook').post((req, res) => {
const request = req.body;
if (request.event.type === 'jwt.refresh-token.revoke') {
// Clean up all the user's stuff here
}
});
Upvotes: 1