Skip to content

Commit

Permalink
printing out cas user information returned from /serviceValidate
Browse files Browse the repository at this point in the history
  • Loading branch information
chownces committed Oct 29, 2022
1 parent 2e20c1c commit 156fbb0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/cadet/auth/providers/cas.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ defmodule Cadet.Auth.Providers.CAS do
}

with {:validate, {:ok, %{body: body, status_code: 200}}} <-
{:validate, HTTPoison.get(config.service_validate_endpoint, [], params: params)},
{:validation_response, data} <- {:validation_response, Jason.decode!(body)},
{:extract_username, %{"name" => username}} <- {:extract_username, data} do
IO.inspect(data)
{:ok, %{token: data, username: username}}
{:validate, HTTPoison.get(config.service_validate_endpoint, [], params: params)} do
# {:validation_response, data} <- {:validation_response, Jason.decode!(body)},
# {:extract_username, %{"name" => username}} <- {:extract_username, data} do
IO.inspect(body)
{:ok, %{token: body, username: "placeholder"}}
else
{:validate, {:ok, %{body: body, status_code: status}}} ->
{:error, :upstream, "Status code #{status} from CAS: #{body}"}
Expand Down

0 comments on commit 156fbb0

Please sign in to comment.