pow-auth / pow_assent

Multi-provider authentication for your Pow enabled app
https://powauth.com
MIT License
318 stars 50 forks source link

Using Pow_Assent without Ecto #214

Closed aram0112 closed 1 year ago

aram0112 commented 2 years ago

Hello! Following this thread and the docs for using Pow in an API, I have pow setup in an Ecto-less Phoenix application. I wanted my application to also use Google OAuth as an authentication method and used this page in the docs to implement it, and I have everything working, except for the final authentication on the provider callback in the authorization controller, where I get the "No :repo configuration option found" error. Given that my application does not use Ecto, I don't have a repo configured and was wondering if it would be possible to provide a different context to PowAssent, in order to allow the final authentication to occur.

danschultzer commented 1 year ago

This is a very old issue so you probably have found a solution or moved on. For posteriority, it's possible to pass a different context using the :user_identities_context config value as described in the docs.

config :my_app, :pow_assent,
  user_identities_context: MyApp.UserIdentities
defmodule MyApp.UserIdentities do
  use PowAssent.Ecto.UserIdentities.Context

  def all(user), do:  {:error, :not_implemented}

  # ...
end