Logging out without calling CometChat.logout()

If I want to logout a user, CometChat.logout() works fine, but the problem is that my log out button is not on a page that has the CometChat running.

I would like to be able to log out the user, without having to download the whole "@cometchat-pro/chat" package.

From what I saw, I have to call DELETE on the /me endpoint and clear local storage to get a clean log out. Is this correct?

Hello @erbanv,

The logout method along with making an API call and clearing local storage does a few more things like clearing memory variables, disconnecting the WS connection, etc. I would advise you to use CometChat.logout().

Warm Regards,

CometChat Pro
Mayur Bhandari

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.