Advertisement
Guest User

Untitled

a guest
Jun 1st, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. export default Ember.Route.extend({
  2. + authManager: Ember.inject.service('session'),
  3. +
  4. + actions: {
  5. + login: function() {
  6. + let data = { username: 'hacluster', password : 'hacluster'};
  7. +
  8. + this.get('authManager').authenticate('authenticator:loginpass', data).then(() => {
  9. + console.log('@todo: WORKS');
  10. + }, (err) => {
  11. + console.log('@todo: UNABLE TO AUTH');
  12. + });
  13. + },
  14. + logout: function() {
  15. + console.log('info: logout presss');
  16. + this.get('authManager').invalidate().then(() => {
  17. + console.log('@todo: LOGOUT works');
  18. + }, (err) => {
  19. + console.log('@todo: LOGOUT is not working');
  20. + });
  21. + },
  22. + show: function() {
  23. + console.log('@todo: SHOW CLUSTER');
  24. + }
  25. + }
  26. +});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement