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

Fixed: Shop logged out when submitting a form for 'Shop' objects (fixed in 8.2.1) #480

Closed
Hammadk opened this issue Sep 28, 2017 · 0 comments

Comments

@Hammadk
Copy link
Member

Hammadk commented Sep 28, 2017

Version 7.3.0 introduced a bug where shops would be logged out when a controller received a shop hash param in an update. This effects version 7.3.0, 7.4.0, 8.0.0, 8.1.0, 8.2.0, and is fixed in 8.2.1.

Root cause

Consider the following case:

  1. You have a model called Shop
  2. In edit.html.erb, you use form_for @shop.

When someone clicks update, Rails will pass a shop hash to the controller and it looks like:
shop: { id: 123, title: 'foobar' }. When this hash is sent to LoginProtection:: login_again_if_different_shop , the shop is logged out.

This was fixed by only comparing the shop param when it was a String. This was fixed here.

@Hammadk Hammadk closed this as completed Sep 28, 2017
@Hammadk Hammadk changed the title Shop logged out when submitting a form for 'Shop' objects (fixed in 8.2.1) Fixed: Shop logged out when submitting a form for 'Shop' objects (fixed in 8.2.1) Sep 28, 2017
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

1 participant