From 1e811b56362c7d45746d357c9cf4918e376de940 Mon Sep 17 00:00:00 2001 From: Mike Buhot Date: Wed, 22 Nov 2023 09:11:42 +1000 Subject: [PATCH] Update MultiProvider example in README.md Use `then/2` to access config at the end of the pipelines --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4e0a42d..638fd56 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ defmodule MultiProviderAuth do def request(provider) do provider |> config!() - |> config[:strategy].authorize_url() + |> then(fn config -> config[:strategy].authorize_url() end) end @spec callback(atom(), map(), map()) :: {:ok, map()} | {:error, term()} @@ -176,7 +176,7 @@ defmodule MultiProviderAuth do provider |> config!() |> Assent.Config.put(:session_params, session_params) - |> config[:strategy].callback(params) + |> then(fn config -> config[:strategy].callback(params) end) end defp config!(provider) do