React Native: How to remove a token using AsyncStorage using JWT?

I am currently saving my React Native token using var jwt = require('jsonwebtoken'); :

 AsyncStorage.setItem('token', response.token) 

And I'm not sure if this is the right way for React Native to check if the token is stored, but in the Chrome Developer Tools browser, in the “Application” and then “Cookie Storage” section, the token and its value are displayed.

Then, to remove the token, I do the following:

 AsyncStorage.removeItem('token') 

but even if I refresh the store’s Cookie page, the token still shows.

Is it deleted, but am I viewing the token incorrectly or is it not deleted at all? If so, what am I doing wrong?

Thank you in advance

+5
source share

Source: https://habr.com/ru/post/1257829/


All Articles