Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should Auth.prototype.signOut pass opt variables in DELETE request? #3

Open
vlod opened this issue Apr 6, 2015 · 3 comments
Open

Comments

@vlod
Copy link

vlod commented Apr 6, 2015

Hi,
First thanks for all your hard work in creating this module!

I'm trying to hook this up (with rails and devise_token_auth) and noticed that Auth.prototype.signOut doesn't supply the opt parameter to the ajax request, like you do in Auth.prototype.emailSignIn

i.e.
$.ajax({
url: signOutUrl,
context: this,
method: 'DELETE',
data: opts, // <-- this is not present??

I want to pass pass the csrf_token that Rails requires to prevent the "Can't verify CSRF token authenticity".

Or am I doing this incorrectly?

Thanks for you help.

@vlod
Copy link
Author

vlod commented Apr 6, 2015

fyi created a pull request

@lynndylanhurley
Copy link
Owner

@vlod - signOut works with the current authenticated user, so it shouldn't require any params. All the data that it needs is stored in the current session.

I would recommend setting protect_from_forgery to null_session for API routes if that's possible. This plugin will provide the equivalent of CSRF protection.

Thanks for the PR, I'll review and merge ASAP

@Ruff9
Copy link

Ruff9 commented Dec 29, 2016

It seems like signOut requires some params, I just submitted an issue about that: #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants