Hi, how are you? How is everything?
I have an app, when the user log into the app, some values are set in a Storage of @ionic/storage.
this.storage.set('email', this.email); this.storage.set('password', this.password);
So far everything is fine, the problem happens when the user wants to LOGOUT. I follow the next steps when the user press the button to LOGOUT.
- Show Loading Alert
- Set a empty empty string to the two values in the storage (email and password)
- Redirect to the LOGIN page (
My code would be as follow:
this.showLoading(); this.storage.set('email', ''); this.storage.set('password', ''); window.location.assign('/');
The problem is that sometimes the “Loading” closes and the data (email and password) reset is not performed, nor the redirection, what happens is that it stays on the same page and nothing happens.
Is it correct the redirection (window.location.assign(’/’)) after set the data in Storage of @ionic/storage. ??