Logging out
In the OneWelcome React Native SDK, a user is treated as logged in as long as the user has an access token for the operation to be executed. Therefore, to logout the user, the access token needs to be revoked. This can be done by calling the logout function. The plugin will remove the access token on the client, and also send a request to the Token Server to invalidate the token server side. If a refresh token is stored on the device, it will persist after the logout action. It can then be used to login again later.
Example code to logout a user: