oivoodoo / devise_masquerade

Extension for devise, enable login as functionality. Add link to the masquerade_path(resource) and use it.
MIT License
538 stars 46 forks source link

Passing any additional arguments to masquerade_path create bad urls #73

Closed madmax closed 3 years ago

madmax commented 3 years ago

If we pass any additional argument to masquerade_path it will create bad URL

masquerade_path(user, test: 1)
/users/masquerade/1.masquerade=CAhfsUnYawRLvUb3QxXYGQ&masqueraded_resource_class=User&test=1?masquerade=CAhfsUnYawRLvUb3QxXYGQ&masqueraded_resource_class=User&test=1

This is because in url_helpers.rb#masquerade_path we pass options twice url helper

send("#{scope}_masquerade_path", resource, opts, *args)

opts are correctly exteracted but we pass them again in *args.

oivoodoo commented 3 years ago

Hi @madmax . Sorry for delay on the issue. it looks like I've just fixed it by #79 . 1.3.1 could probably solve the issue or bring more who knows :)