-
Notifications
You must be signed in to change notification settings - Fork 17
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
#sign_out method needs patching? #24
Comments
The patch is indeed needed to make webrat work. def sign_out(resource_or_scope = nil) return unless resource_or_scope # nothing to do when calling sign_out without resource_or_scope scope = Devise::Mapping.find_scope!(resource_or_scope) warden.user(scope) # Without loading user here, before_logout hook is not called warden.raw_session.inspect # Without this inspect here. The session does not clear. warden.logout(scope) # user id session[:user_id] = nil @current_user = nil end upd: |
"Devise has configuration option config.sign_out_all_scopes = false. Setting it to true will lead to the same error." Unfortunately I don't know enough about the Devise/Warden internals to know how to handle setting such an option. Would be better if we ask such questions on the Devise or Warden user group list IMO ;) |
Hello.
Today, after I installed cream (before that I had only roles_generic and roles_active_record), request specs, beginning with visit 'users/sign_out' (very common for integration tests (rspec requests and cucumber)), started to fail with ArgumentError: wrong number of arguments (0 for 1).
Further exploration led me to
cream-0.9.2/lib/cream/controller/user_control.rb:71 --
sign_out method requires (resource_or_scope) argument. And if i just visit 'users/sign_out' during request test -- resource_or_scope is nil.
To reproduce -- simply begin any request test with visit 'users/sign_out' (assuming that Devise and it is default routes are used).
The same behaviour in real-user experience I can get, if i press sign_out button (or visit 'localhost:8080/users/sign_out') at the very first request after webserver started.
No pull request at this time. I'm not familliar with what warden does so not sure is it possible to simply make it like this:
The text was updated successfully, but these errors were encountered: