From 7a6abf7b0e20a5df5e2e612f97df57d5dd153963 Mon Sep 17 00:00:00 2001 From: Tymon Tobolski Date: Wed, 30 Jul 2025 14:30:02 +0200 Subject: [PATCH] Support optional params --- lib/ueberauth/strategy/linear.ex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ueberauth/strategy/linear.ex b/lib/ueberauth/strategy/linear.ex index bec4703..b6c8cc9 100644 --- a/lib/ueberauth/strategy/linear.ex +++ b/lib/ueberauth/strategy/linear.ex @@ -28,6 +28,8 @@ defmodule Ueberauth.Strategy.Linear do [] |> with_scopes(conn) |> with_state_param(conn) + |> with_optional(:prompt, conn) + |> with_optional(:actor, conn) |> Keyword.put(:redirect_uri, callback_url) module = option(conn, :oauth2_module) @@ -165,6 +167,10 @@ defmodule Ueberauth.Strategy.Linear do Keyword.get(options(conn), key, Keyword.get(default_options(), key)) end + defp with_optional(opts, key, conn) do + if option(conn, key), do: Keyword.put(opts, key, option(conn, key)), else: opts + end + defp get_redirect_uri(%Plug.Conn{} = conn) do config = Application.get_env(:ueberauth, Ueberauth)