Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defoverride for definitions from Assent.Strategy when useing Assent.Strategy.OAuth2.Base #155

Open
paulbalomiri opened this issue Jul 21, 2024 · 0 comments

Comments

@paulbalomiri
Copy link

I'm implementing a provider, which needs an aditional body parameter when calling the token endpoint.
in order to override &Assent.Strategy.callback/2, i think that the additional defoverridable Helpers (or defoverridable callback: 2) is needed, otherwhise the implementation in my custom module is ignored.

** Should this overridable definition not be included in the __using/2 definition of Assent.Strategy.OAuth2.Base?

The use definition defines these behavoiurs:

@behaviour Assent.Strategy
@behaviour unquote(__MODULE__)

The only defoverridable in the Assent.Strategy.OAuth2.Base.__using__/1 Macro is this one:

defoverridable unquote(__MODULE__)

In order to override the callback/2 in my implementation module i need to do this:

defmodule CanteAuth.Assent.Strategy.Anaf do
  use Assent.Strategy.OAuth2.Base
 #Shouldn't this be in Assent.Strategy.OAuth2.Base.__using__/1?
  defoverridable Helpers
 ...
  @impl Helpers
  def callback(config, params) do

Is the macro Assent.Strategy.OAuth2.Base.__using__/1 really missing the line

defoverridable Helpers

or am I missing something obvious, for overriding functions imported from Assent.Strategy?

Thank you for this wonderful library! ❤️

paulbalomiri added a commit to paulbalomiri/assent that referenced this issue Jul 21, 2024
…rategy.OAuth2.Base`

Without this defoverridable callback(config, params) is not overridable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant