From 0fb7aafc080416a9f0d03ae40b1610be069fbe8b Mon Sep 17 00:00:00 2001 From: Yordis Prieto Date: Mon, 11 Sep 2023 22:53:38 -0400 Subject: [PATCH] fix: codegen token must use base64url encoding --- lib/mix/tasks/guardian.gen.secret.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mix/tasks/guardian.gen.secret.ex b/lib/mix/tasks/guardian.gen.secret.ex index 223bce8d3..9035078f8 100644 --- a/lib/mix/tasks/guardian.gen.secret.ex +++ b/lib/mix/tasks/guardian.gen.secret.ex @@ -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")