Skip to content

Commit

Permalink
Fix return type of missing_claim error
Browse files Browse the repository at this point in the history
  • Loading branch information
maennchen committed Sep 19, 2023
1 parent 1df89a9 commit 663f541
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/oidcc_token.erl
Original file line number Diff line number Diff line change
Expand Up @@ -698,12 +698,12 @@ validate_id_token(IdToken, ClientContext, Nonce) ->
verify_aud_claim(#{<<"aud">> := Audience} = Claims, ClientId) when is_list(Audience) ->
case lists:member(ClientId, Audience) of
true -> ok;
false -> {missing_claim, {<<"aud">>, ClientId}, Claims}
false -> {error, {missing_claim, {<<"aud">>, ClientId}, Claims}}
end;
verify_aud_claim(#{<<"aud">> := ClientId}, ClientId) ->
ok;
verify_aud_claim(Claims, ClientId) ->
{missing_claim, {<<"aud">>, ClientId}, Claims}.
{error, {missing_claim, {<<"aud">>, ClientId}, Claims}}.

-spec verify_azp_claim(Claims, ClientId) -> ok | {error, error()} when
Claims :: oidcc_jwt_util:claims(), ClientId :: binary().
Expand Down

0 comments on commit 663f541

Please sign in to comment.