diff --git a/lib/auth_web/controllers/apikey_controller.ex b/lib/auth_web/controllers/apikey_controller.ex index 10027e20..cc5af3e5 100644 --- a/lib/auth_web/controllers/apikey_controller.ex +++ b/lib/auth_web/controllers/apikey_controller.ex @@ -33,14 +33,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) |> Base58.encode - |> IO.inspect(label: "secret") - client = Fields.AES.encrypt(person_id) |> Base58.encode - |> IO.inspect(label: "client") params = Map.merge(apikey_params, %{ - "client_secret" => secret, - "client_id" => client, + "client_secret" => encrypt_encode(person_id), + "client_id" => encrypt_encode(person_id), "person_id" => person_id }) case Apikey.create_apikey(params) do diff --git a/lib/auth_web/templates/apikey/show.html.eex b/lib/auth_web/templates/apikey/show.html.eex index e85b4622..6f5c0ecd 100644 --- a/lib/auth_web/templates/apikey/show.html.eex +++ b/lib/auth_web/templates/apikey/show.html.eex @@ -1,17 +1,16 @@ -
- DWYL_API_KEY: -
- Name: + Key Name: <%= @apikey.name %>
@@ -21,7 +20,7 @@- Url: + URL: <%= @apikey.url %>