From 81c790faaca93e8886414f3e4c1e7e50c7f514cc Mon Sep 17 00:00:00 2001 From: nelsonic Date: Sat, 25 Apr 2020 23:45:14 +0100 Subject: [PATCH] use Base58.encode in apikey_controller.ex #49 --- lib/auth_web/controllers/apikey_controller.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/auth_web/controllers/apikey_controller.ex b/lib/auth_web/controllers/apikey_controller.ex index f2ce4166..aff4b952 100644 --- a/lib/auth_web/controllers/apikey_controller.ex +++ b/lib/auth_web/controllers/apikey_controller.ex @@ -17,10 +17,10 @@ defmodule AuthWeb.ApikeyController do def create(conn, %{"apikey" => apikey_params}) do IO.inspect(apikey_params, label: "apikey_params") person_id = conn.assigns.decoded.id - secret = Fields.AES.encrypt(person_id) |> Base.encode64 + secret = Fields.AES.encrypt(person_id) |> Base58.encode |> IO.inspect(label: "secret") - client = Fields.AES.encrypt(person_id) |> Base.encode64 + client = Fields.AES.encrypt(person_id) |> Base58.encode |> IO.inspect(label: "client") params = Map.merge(apikey_params, %{ "client_secret" => secret,