From 74dfbf7595fa057ca8b943404d74f04648ddb47f Mon Sep 17 00:00:00 2001 From: James Harton <59449+jimsynz@users.noreply.github.com> Date: Fri, 16 Dec 2022 13:53:03 +1300 Subject: [PATCH] improvement: add `icon` field to OAuth2 strategy. (#100) --- lib/ash_authentication/dsl.ex | 3 ++- lib/ash_authentication/strategies/oauth2.ex | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/ash_authentication/dsl.ex b/lib/ash_authentication/dsl.ex index 5b1f443..409de7a 100644 --- a/lib/ash_authentication/dsl.ex +++ b/lib/ash_authentication/dsl.ex @@ -700,7 +700,8 @@ defmodule AshAuthentication.Dsl do auth_method: :client_secret_post, authorize_path: "/authorize", token_path: "/oauth/token", - user_path: "/userinfo" + user_path: "/userinfo", + icon: :auth0 ] }) end diff --git a/lib/ash_authentication/strategies/oauth2.ex b/lib/ash_authentication/strategies/oauth2.ex index 6693042..0a6b7b5 100644 --- a/lib/ash_authentication/strategies/oauth2.ex +++ b/lib/ash_authentication/strategies/oauth2.ex @@ -237,7 +237,8 @@ defmodule AshAuthentication.Strategy.OAuth2 do identity_relationship_user_id_attribute: :user_id, provider: :oauth2, name: nil, - resource: nil + resource: nil, + icon: nil alias AshAuthentication.Strategy.OAuth2 @@ -267,6 +268,7 @@ defmodule AshAuthentication.Strategy.OAuth2 do identity_relationship_user_id_attribute: atom, provider: atom, name: atom, - resource: module + resource: module, + icon: nil | atom } end