Skip to content

Commit de02e44

Browse files
authored
Add padding: false to Base.encode64/2 in New generator (#6060)
To keep the same pattern as used in the `gen.secret` task.
1 parent f4ee4a0 commit de02e44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

installer/lib/phx_new/generator.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ defmodule Phx.New.Generator do
449449
defp phoenix_js_path(path), do: "../../#{path}/"
450450

451451
defp random_string(length),
452-
do: :crypto.strong_rand_bytes(length) |> Base.encode64() |> binary_part(0, length)
452+
do: :crypto.strong_rand_bytes(length) |> Base.encode64(padding: false) |> binary_part(0, length)
453453

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

0 commit comments

Comments
 (0)