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

Swap session, socket arguments in phx.gen.auth mount_current_user #5435

Merged
merged 1 commit into from
May 30, 2023

Conversation

zolrath
Copy link
Contributor

@zolrath zolrath commented Apr 22, 2023

Hello!

When using the generated auth files from mix phx.gen.auth attempting to turn socket = mount_current_user(session, socket) into a pipeline requires the user reorder the arguments.

If we change mount_current_user to follow the general Elixir convention of the struct being transformed as the first argument it becomes easy to turn socket = mount_current_user(socket, session) into:

    socket =
      socket
      |> mount_current_user(session)
      |> mount_session_id(session)
      |> mount_another_thing(session)

@chrismccord chrismccord merged commit 3b2258e into phoenixframework:main May 30, 2023
@chrismccord
Copy link
Member

❤️❤️❤️🐥🔥

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