What is the right way to proceed the logout action of the User when using JWT, Rails API and a JS front-end framework, for example Ember JS ? What I'm actually doing is:
- use Rails 5.2 as API
- use Ember JS 3.3 as front-end
- use Ember Simple Auth as OAuth add-on
- example app, its master branch, works as needed
- example app, its without login branch fails to logout the User
- check the presence and pass in a token in every request between Rails API and Ember JS apps.
The questions I have are:
Should I keep a token value in the backend model (User, for example) ? I need it to make another request in the background on the backend side.
Should I set the token value to
nil
when the User logs out in the backend ?What am I doing wrong with ESA as for logout action ?
Actually the token value is kept in a cookie on the client side (see https://github.com/simplabs/ember-simple-auth for more details). I followed their guides and the dummy app they provide.
- I also had a discussion on Ember JS Forum and tried to follow some tips and advises, still no success.
Thank you.