Browse Source

Removing user data from secure storage when logout.

master
GabrielTrettel 3 years ago
parent
commit
802628e13e
  1. 10
      src/app/auth/storage.js
  2. 1
      src/app/screens/AccountScreen.js

10
src/app/auth/storage.js

@ -45,4 +45,12 @@ const getUser = async () => {
} }
}; };
export default { setToken, getUser, removeToken, getToken, setUser };
const removeUser = async () => {
try {
await SecureStore.deleteItemAsync(userKey);
} catch (e) {
console.log("Error while removing authToken");
}
};
export default { setToken, getUser, removeToken, getToken, setUser, removeUser };

1
src/app/screens/AccountScreen.js

@ -79,6 +79,7 @@ function AccountScreen(props) {
const logout = () => { const logout = () => {
setUser(null); setUser(null);
authStorage.removeToken(); authStorage.removeToken();
authStorage.removeUser();
}; };
const activationActions = () => { const activationActions = () => {

Loading…
Cancel
Save