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

:require_no_authentication for "edit" method doesn't allow the sign out code to be executed #765

Open
rubengut opened this issue Jun 22, 2018 · 2 comments

Comments

@rubengut
Copy link

rubengut commented Jun 22, 2018

When accepting an invitation, edit method in Invitations Controller has code to sign out a user/resource if one is already signed in.
See:
https://github.com/scambra/devise_invitable/blob/master/app/controllers/devise/invitations_controller.rb#L40

This is something I needed in my project and tried to add myself overriding the edit method in the Invitations Controller. But I noticed my method wasn't even being called. It was because of the before filter require_no_authentication. Then I noticed the original edit code already had the code I needed, but it was just not being executed.

I ended up overriding the controller with only this line:

prepend_before_action :require_no_authentication, :only => [:update, :destroy]

@scambra
Copy link
Owner

scambra commented Jun 25, 2018

I have removed that line, because it didn't work, now you may use in your controller this line:
prepend_before_action :sign_out, only: :edit

@scambra
Copy link
Owner

scambra commented Jun 25, 2018

See #701

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

2 participants