Skip to content

Commit

Permalink
fix: bug where nil is not allowed but is returned from secret funct…
Browse files Browse the repository at this point in the history
…ions.
  • Loading branch information
jimsynz committed Aug 18, 2024
1 parent 59d1435 commit ef1b122
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ash_authentication/strategies/oauth2/plug.ex
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ defmodule AshAuthentication.Strategy.OAuth2.Plug do
{:ok, nil} when allow_nil? ->
{:ok, config}

{:ok, nil} ->
path = [:authentication, :strategies, strategy.name, secret_name]
{:error, Errors.MissingSecret.exception(path: path, resource: strategy.resource)}

{:ok, value} when is_binary(value) and byte_size(value) > 0 ->
{:ok, Map.put(config, secret_name, value)}

Expand Down

0 comments on commit ef1b122

Please sign in to comment.