mardi 1 mars 2016

Logging out a user with Custom Authenticator using Ember Simple Auth

I have a Custom Authenticator that I am using with the Ember Simple Auth (1.0.1) add-on. To log a user out, I call invalidate() on the session object. As documented, I also resolve the promise in the custom authenticator's invalidate method like so:

invalidate() {
    return RSVP.resolve();
 }

Reading the documentation on the invalidate method for the Base Authenticator that my custom authenticator extends, I expect the session to remove any data that was in local storage (which is the default storage for the session data). However, upon resolving the promise as told I still see the localstorage data persist after invalidating the session which causes the session to not be invalidated.

"This method returns a promise. A resolving promise will result in the session becoming unauthenticated." See http://ift.tt/1QSMhbt

Do I need to pragmatically clear the local storage, or do I need to import the localStorageStore and use its clear() method?

Thanks!




Aucun commentaire:

Enregistrer un commentaire