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

Different Layouts #132

Open
TimBoing opened this issue May 29, 2023 · 1 comment
Open

Different Layouts #132

TimBoing opened this issue May 29, 2023 · 1 comment

Comments

@TimBoing
Copy link

  • I am masquerading the User model with an Admin model
  • I skip_before_action the authenticate_admin! method for the user app side
  • I am using different layouts for admin side and user app side
  • My buttons with the masquerade_path are located on the admin side
  • It seems that having different layouts have the effect to trigger twice the masquerades#show, juste after button click and after rendering the user layout (turbolinks?)
  • The first time everything works fine but the second time "authenticate_scope!" raises an error because the admin cannot be found anymore
  • My current solution: I added "return if user_masquerade?" in the authenticate_scope! method
  • Am I doing something wrong? Should "return if user_masquerade?" be added to your default "authenticate_scope!" method?
@oivoodoo
Copy link
Owner

Hi @TimBoing

Thank you for reporting the issue but at the same time it's pretty d to reproduce your flow. would it be possible for you to make the short demo in the public repo to debug the issue? the other solution you can fork the gem and check out the dummy app in spec/.

it's having a similar project that you described but without layouts, probably you can PR-only dummy app changes with layouts and I can pick it up to debug.

Thank you!

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