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

Devise’s authenticate block breaks previews #445

Closed
nicieja opened this issue Apr 29, 2023 · 9 comments
Closed

Devise’s authenticate block breaks previews #445

nicieja opened this issue Apr 29, 2023 · 9 comments
Labels
bug Something isn't working v2.x Issues/PRs that affect the v2.x line of releases
Milestone

Comments

@nicieja
Copy link

nicieja commented Apr 29, 2023

Describe the bug

Am I the only one who gets undefined method 'authenticate!' for nil:NilClass when I use Devise’s authenticate block in routes like this: https://github.com/changepack/changepack/blob/5d27756550051dd6adafe52e8ecc83186bf12ea9/config/routes.rb#L9

To Reproduce

Steps to reproduce the behavior:

  1. git clone git@github.com:changepack/changepack.git
  2. Go to http://localhost:3000/lookbook
  3. Click on the only available component
  4. See below.

Screenshot 2023-04-29 at 11 07 47

Expected behavior

I expect to see the component previewed. When I comment the authenticate block out, everything works perfectly.

Version numbers

Please complete the following information:

  • Lookbook: 2.0.0
  • ViewComponent: 3.0.0
  • Rails: 7.0.4
  • Ruby: 3.2.1
@nicieja nicieja added the bug Something isn't working label Apr 29, 2023
@guillaumebriday-pa
Copy link

I got the exact same issue

@allmarkedup
Copy link
Collaborator

@nicieja thanks for bringing this to my attention - I don't use Devise personally so I haven't run into this before, but I can replicate it with the repo you provided so just looking into it now. Will hopefully have a fix up soon 👍

@allmarkedup
Copy link
Collaborator

Hey @nicieja @guillaumebriday-pa - I believe I have a fix for this now in PR #450.

It works for me in the changepack/changepack app now but it would be great to get confirmation if you have a chance to give it a try by bundling Lookbook from the devise-preview-fix branch.

It is a bit of a hack to be honest - the issue you are seeing is actually being caused by a workaround for another bug. But if this works for now then I'll ship it for now and hopefully spend a bit of time on unpicking the actual root cause of the problem when I have a little more time.

I'm going to go a little more testing but once I'm happy (and unless I hear back that it is still causing issues for either of you) I'll merge it in and get it out in the next release (which will be v1.0.1).

@allmarkedup
Copy link
Collaborator

(@nicieja as an aside, Changepack looks very interesting! I'm keen to dig in a bit more when I get a chance 😊)

@allmarkedup allmarkedup added this to the v2.x milestone May 3, 2023
@allmarkedup allmarkedup added the v2.x Issues/PRs that affect the v2.x line of releases label May 3, 2023
@guillaumebriday-pa
Copy link

The fix actually works for me as well!

Thank you for your reactivity! 🙏

@allmarkedup
Copy link
Collaborator

@guillaumebriday-pa great, thanks for letting me know - I'll merge that in now 👍

@guillaumebriday-pa
Copy link

Awesome 🙏 , can you release the 2.0.1?

@allmarkedup
Copy link
Collaborator

@guillaumebriday-pa @nicieja 2.0.1 is now out that includes the fix for this. Thanks for your help!

@nicieja
Copy link
Author

nicieja commented May 4, 2023

@allmarkedup Didn’t look at GitHub yesterday but I can confirm that the fix works for me too. Thanks!

(as an aside, Changepack looks very interesting! I'm keen to dig in a bit more when I get a chance 😊)

Glad you like it! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2.x Issues/PRs that affect the v2.x line of releases
Projects
None yet
Development

No branches or pull requests

3 participants