Skip to content

Commit

Permalink
fix: codegen token must use base64url encoding (ueberauth#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
yordis authored Sep 12, 2023
1 parent a42ed60 commit cc125fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mix/tasks/guardian.gen.secret.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ defmodule Mix.Tasks.Guardian.Gen.Secret do
end

defp random_string(length) when length > 31 do
length |> :crypto.strong_rand_bytes() |> Base.encode64() |> binary_part(0, length)
length |> :crypto.strong_rand_bytes() |> Base.url_encode64() |> binary_part(0, length)
end

defp random_string(_), do: Mix.raise("The secret should be at least 32 characters long")
Expand Down

0 comments on commit cc125fe

Please sign in to comment.