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

Add documentation to provide a guide for how to use pundit with rails 8's built-in authentication generator #850

Merged

Conversation

SuzukiRyuichiro
Copy link
Contributor

@SuzukiRyuichiro SuzukiRyuichiro commented Feb 28, 2025

Please disregard if this is not a necessary update on the documentation.
I was testing the combination of pundit and the new rails 8 authentication generator. If you use the built in authentication generator, you would get the currently authenticated user via Current.user not current_user. Since pundit expect current_user, some people suggesting to add that helper to the framework. rails/rails#54202

I just thought it might be a good thing to point out that it could be resolved with the portion that is already explained in the README.

My suggestion is just to make it more obvious by giving the exact solution.

To do

  • I have read the contributing guidelines.
  • I have added relevant tests.
  • I have adjusted relevant documentation.
  • I have made sure the individual commits are meaningful.
  • I have added relevant lines to the CHANGELOG.

@SuzukiRyuichiro SuzukiRyuichiro force-pushed the current-user-for-rails-8-auth branch from 4b93a7d to b117d41 Compare February 28, 2025 07:14
@SuzukiRyuichiro SuzukiRyuichiro changed the title Add some documentation to provide hints for how to use pundit when people use rails 8's default authentication generator Add documentation to provide a guide for how to use pundit with rails 8's built-in authentication generator Feb 28, 2025
@Burgestrand
Copy link
Member

Thank you, this looks great! I agree.

@Burgestrand Burgestrand merged commit 51ce6a9 into varvet:main Mar 3, 2025
12 of 13 checks passed
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

Successfully merging this pull request may close these issues.

2 participants