From 7cc660b8e03456acc427a2df3374639f854537be Mon Sep 17 00:00:00 2001 From: Max Filipovich Date: Thu, 2 Jun 2022 19:02:21 +0200 Subject: [PATCH] Make resource_owner validation more robust --- lib/ex_oauth2_provider/oauth2/authorization/strategy/code.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ex_oauth2_provider/oauth2/authorization/strategy/code.ex b/lib/ex_oauth2_provider/oauth2/authorization/strategy/code.ex index 40b3cb02..2b239fcd 100644 --- a/lib/ex_oauth2_provider/oauth2/authorization/strategy/code.ex +++ b/lib/ex_oauth2_provider/oauth2/authorization/strategy/code.ex @@ -192,7 +192,7 @@ defmodule ExOauth2Provider.Authorization.Code do defp validate_resource_owner({:ok, %{resource_owner: resource_owner} = params}) do case resource_owner do - %{__struct__: _} -> {:ok, params} + record when is_map(record) -> {:ok, params} _ -> Error.add_error({:ok, params}, Error.invalid_request()) end end