logout

Revokes the current authentication token.

If there were any, real-time subscriptions are cancelled.

If this action is successful, then the jwt property of this class instance is unset.


Copied to clipboard!
logout();

Usage

Copied to clipboard!
const credentials = { username: 'foo', password: 'bar' };

try {
  await kuzzle.auth.login('local', credentials);

  await kuzzle.auth.logout();

  console.log('Success');
} catch (error) {
  console.error(error.message);
}