diff --git a/lib/auth_web/controllers/auth_controller.ex b/lib/auth_web/controllers/auth_controller.ex index 99105a82..9ee69e28 100644 --- a/lib/auth_web/controllers/auth_controller.ex +++ b/lib/auth_web/controllers/auth_controller.ex @@ -96,7 +96,7 @@ defmodule AuthWeb.AuthController do # return true if the app_id is linked to the client_id otherwise false # Check if the api key hasn't been deleted - defp client_id_is_current?(app_id, client_id) do + def client_id_is_current?(app_id, client_id) do case Auth.Apikey.get_apikey_by_app_id(app_id) do nil -> false diff --git a/test/auth_web/controllers/auth_controller_test.exs b/test/auth_web/controllers/auth_controller_test.exs index c13781a1..3e1ad40f 100644 --- a/test/auth_web/controllers/auth_controller_test.exs +++ b/test/auth_web/controllers/auth_controller_test.exs @@ -512,4 +512,8 @@ defmodule AuthWeb.AuthControllerTest do conn2 = conn |> admin_login() |> get("/logout", %{}) assert html_response(conn2, 200) =~ "Successfully logged out." end + + test "client_id_is_current? nil path" do + assert AuthWeb.AuthController.client_id_is_current?(0, 1) == false + end end