Skip to content

Commit

Permalink
Add padding: false to Base.encode64/2 in New generator (#6060)
Browse files Browse the repository at this point in the history
To keep the same pattern as used in the `gen.secret` task.
  • Loading branch information
leandrocp authored Jan 31, 2025
1 parent f4ee4a0 commit de02e44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion installer/lib/phx_new/generator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ defmodule Phx.New.Generator do
defp phoenix_js_path(path), do: "../../#{path}/"

defp random_string(length),
do: :crypto.strong_rand_bytes(length) |> Base.encode64() |> binary_part(0, length)
do: :crypto.strong_rand_bytes(length) |> Base.encode64(padding: false) |> binary_part(0, length)

# In the context of a HEEx attribute value, transforms a given message into a
# dynamic `gettext` call or a fixed-value string attribute, depending on the
Expand Down

0 comments on commit de02e44

Please sign in to comment.