Deregister user
Deregistering a user implies the removal of all of their data (including access tokens and refresh tokens) from the device. The SDK will also send a request to the Token Server to revoke all tokens associated with the user. The client credentials will remain stored on the device.
The OneWelcome React Native SDK exposes the deregisterUser function to properly deregister a user, as described above.
Example code to deregister a user:
OneWelcomeSdk.deregisterUser(profileId)
.then(() => console.log('Deregister succeed!'))
.catch(error => console.error('Deregister failed: ', error.message))
Note that any existing user can be deregistered. They do not necessarily have to be logged in.