Skip to content

Commit

Permalink
fix typo in test
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Apr 29, 2020
1 parent 254e7a5 commit 178a6e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/auth_web/controllers/auth_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ defmodule AuthWeb.AuthController do
conn
# |> put_resp_header("www-authenticate", "Bearer realm=\"Person access\"")
|> put_resp_content_type("text/html")
|> send_resp(401, "invalid client_id")
|> send_resp(401, "invalid AUTH_API_KEY/client_id please check.")
|> halt()
end

Expand All @@ -97,7 +97,7 @@ defmodule AuthWeb.AuthController do
case not is_nil(client_id) do
true -> # Lookup client_id in apikeys table
person_id = AuthWeb.ApikeyController.decode_decrypt(client_id)
IO.inspect(person_id, label: "person_id")
# IO.inspect(person_id, label: "person_id")
if person_id == 0 do # decode_decrypt fails with state 0
# IO.inspect(person_id, label: "person_id:88")
0
Expand Down
4 changes: 2 additions & 2 deletions test/auth_web/controllers/auth_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ defmodule AuthWeb.AuthControllerTest do
test "google_handler/2 with invalid client_id", %{conn: conn} do
invalid_key = String.slice(AuthPlug.Token.client_id(), 0..-2)
conn = get(conn, "/auth/google/callback",
%{code: "234", state: "www.example.com" <>
%{code: "234", state: "www.example.com/" <>
"&client_id=" <> invalid_key })
# assert html_response(conn, 200) =~ "google account"
assert html_response(conn, 401) =~ "invalid client_id"
assert html_response(conn, 401) =~ "invalid"
end


Expand Down

0 comments on commit 178a6e2

Please sign in to comment.