question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ember-simple-auth-devise invalidate() does nothing

See original GitHub issue

ember-simple-auth-devise invalidate() does nothing.

  /**
Does nothing

@method invalidate
@return {Ember.RSVP.Promise} A resolving promise
*/
  invalidate: function() {
    return Ember.RSVP.resolve();
  }

Ember never logs out, not even if a log out is done from the back end.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:19 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
benbabicscommented, Aug 4, 2016

I just wanted to pass on my findings using ember-simple-auth and the gem ‘devise_token_auth’. I was required to send along the uid, client and access-token otherwise /users/sign_out would throw a 404. Hope this helps someone else. Thanks, @samselikoff for the example.

In app/authenticators/devise.js

export default DeviseAuthenticator.extend({
  ...
  invalidate: function(session) {
    return Ember.$.ajax({
      url:  '/users/sign_out',
      type: 'DELETE',
      beforeSend(request) {
        request.setRequestHeader( 'uid', session.uid );
        request.setRequestHeader( 'client', session.client );
        request.setRequestHeader( 'access-token', session.accessToken );
      }
    });
  },
  ...
});
1reaction
marcoowcommented, Feb 16, 2015

@7sedam7: you’re probably not mixing in the ApplicationRouteMixin in your application route.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ember-simple-auth-devise invalidate() does nothing · Issue #201
When the method return a resolving promise then it doesn't intercept invalidation of the session and Ember.SimpleAuth standard session ...
Read more >
DeviseAuthenticator - Ember Simple Auth
Overrides: invalidate of BaseAuthenticator . Does nothing. Returns. → Ember.RSVP.Promise. A resolving promise.
Read more >
EmberJS retrieve current user from ember-simple-auth ...
In your application controller, you are calling currentUser() from the session service, while you've defined currentUser() in your oauth2.js ...
Read more >
An Overview of Ember Simple Auth - Codementor
Ember Simple Auth is a lightweight library used for session management, authentication, and authorization. This post is based on the Codementor Office Hours ......
Read more >
New to ember. Questions on authentication with devise/rails
I have a rails API that uses devise with LDAP authentication. This portion of it is working fine. I am selecting to not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found