Skip to content

Instantly share code, notes, and snippets.

@wycats
Forked from anonymous/session.js
Last active June 21, 2019 22:32
Show Gist options
  • Save wycats/8b125448e27ac49cd97b to your computer and use it in GitHub Desktop.
Save wycats/8b125448e27ac49cd97b to your computer and use it in GitHub Desktop.
import Ember from 'ember';
export default Ember.Object.extend({
savedTransition: null,
init: function() {
this.set('isLoggedIn', localStorage.isLoggedIn);
},
loginUser: function() {
this.set('isLoggedIn', true);
localStorage.isLoggedIn = true;
},
logoutUser: function() {
this.set('savedTransition', null);
this.set('isLoggedIn', null);
delete localStorage.isLoggedIn;
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment