Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/oidcc/token.ex
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ defmodule Oidcc.Token do
scope: :oidcc_scope.scopes()
}

@type retrieve_opts() :: :oidcc_token.retrieve_opts()

@doc """
retrieve the token using the authcode received before and directly validate
the result.
Expand Down Expand Up @@ -151,7 +153,7 @@ defmodule Oidcc.Token do
@spec retrieve(
auth_code :: String.t(),
client_context :: ClientContext.t(),
opts :: :oidcc_token.retrieve_opts()
opts :: retrieve_opts()
) ::
{:ok, t()} | {:error, :oidcc_token.error()}
def retrieve(auth_code, client_context, opts) do
Expand Down Expand Up @@ -293,14 +295,14 @@ defmodule Oidcc.Token do
@spec validate_id_token(
id_token :: String.t(),
client_context :: ClientContext.t(),
nonce :: String.t() | any
nonce_or_opts :: String.t() | :any | retrieve_opts()
) :: {:ok, :oidcc_jwt_util.claims()} | {:error, :oidcc_token.error()}
def validate_id_token(id_token, client_context, nonce),
def validate_id_token(id_token, client_context, nonce_or_opts),
do:
:oidcc_token.validate_id_token(
id_token,
ClientContext.struct_to_record(client_context),
nonce
nonce_or_opts
)

@doc """
Expand Down
Loading