danschultzer / phoenix_oauth2_provider

Get an OAuth 2 provider running in your phoenix with controllers, views and models in just two minutes
MIT License
84 stars 41 forks source link

PhoenixOauth2Provider.ApplicationController.init/1 is undefined #37

Closed barberj closed 4 years ago

barberj commented 4 years ago
Screen Shot 2020-07-17 at 12 52 39 PM

I ran the generators for both this repo and ex_oauth2_provider. Is the ApplicationController suppose to be manually created and if so do you have directions around its context?

danschultzer commented 4 years ago

I think it's because you got it set up as:

  scope "/", MaitreDWeb do
    pipe_through :api

    oauth_api_routes()
  end

  scope "/", MaitreDWeb do
    pipe_through [:browser, :protected]

    oauth_routes()
  end

You should remove the alias, and just keep it like this:

  scope "/" do
    pipe_through :api

    oauth_api_routes()
  end

  scope "/" do
    pipe_through [:browser, :protected]

    oauth_routes()
  end
barberj commented 4 years ago

Thanks for quick response. That fixed it.