Skip to content

Commit

Permalink
Update parsing of client options
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuret committed Jul 26, 2018
1 parent 285588e commit 9a3492c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/ueberauth/adfs.ex
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ defmodule Ueberauth.Strategy.ADFS do
def credentials(conn) do
token = conn.private.adfs_token

%Credentials{token: token.access_token}
%Credentials{token: token.token}
end

def info(conn) do
Expand Down Expand Up @@ -117,8 +117,8 @@ defmodule Ueberauth.Strategy.ADFS do

conn = put_private(conn, :adfs_token, jwt)

with %Joken.Token{claims: claims} <- jwt do
put_private(conn, :adfs_claims, claims)
with %Joken.Token{claims: claims_user} <- jwt do
put_private(conn, :adfs_user, claims_user)
else
_ -> set_errors!(conn, [error("token", "unauthorized")])
end
Expand Down
6 changes: 2 additions & 4 deletions lib/ueberauth/adfs/oauth.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ defmodule Ueberauth.Strategy.ADFS.OAuth do
]

def client(opts \\ []) do
config = Application.get_env(:ueberauth, Ueberauth.Strategy.ADFS)
config = Application.get_env(:ueberauth, Ueberauth.Strategy.ADFS) || []

with {value, new_config} when not is_nil(value) <- Keyword.pop(config, :adfs_url) do
adfs_url = URI.parse(value)
Expand All @@ -44,9 +44,7 @@ defmodule Ueberauth.Strategy.ADFS.OAuth do
end

def authorize_url!(opts \\ []) do
opts
|> client()
|> Client.authorize_url!()
Client.authorize_url!(client(), opts)
end

def get_token(code, opts \\ []) do
Expand Down

0 comments on commit 9a3492c

Please sign in to comment.