riverrun / phauxth

Not actively maintained - Authentication library for Phoenix, and other Plug-based, web applications
409 stars 20 forks source link

Compile error on simple demo #8

Closed jacobw56 closed 7 years ago

jacobw56 commented 7 years ago

Just made a new project and grabbed 0.10 for a simple demo, getting the following error on running the migrations for the first time:

== Compilation error on file lib/sesh2/web/controllers/confirm_controller.ex ==
** (UndefinedFunctionError) function Phauxth.Confirm.init/1 is undefined or private
    Phauxth.Confirm.init([])
    (plug) lib/plug/builder.ex:193: Plug.Builder.init_module_plug/3
    (plug) lib/plug/builder.ex:181: anonymous fn/4 in Plug.Builder.compile/3
    (elixir) lib/enum.ex:1755: Enum."-reduce/3-lists^foldl/2-0-"/3
    (plug) lib/plug/builder.ex:181: Plug.Builder.compile/3
    (phoenix) expanding macro: Phoenix.Controller.Pipeline.__before_compile__/1
    lib/sesh2/web/controllers/confirm_controller.ex:1: Sesh2.Web.ConfirmController (module)
    (elixir) lib/kernel/parallel_compiler.ex:117: anonymous fn/4 in 
Kernel.ParallelCompiler.spawn_compilers/1

This is a very basic setup, just followed the guides on the wiki. Steps to recreate:

mix phx.new sesh2
mix phauxth.new --confirm --api
vim mix.exs #add dependency
vim router.ex #add routes
mix ecto.setup

EDIT: So I had a chance to actually sit down and look, and there are no init or call functions in Phauxth.Confirm. I'm guessing this is expected? Should we be whipping up our own version of these depending on what method (email/sms) we want to use?

riverrun commented 7 years ago

With 0.10, some of the plug functions have been reworked to verify/2 functions which are called within the confirm function. There is a little more information about this on the wiki, which I am in the process of updating.

In your case, I think after upgrading the installer to the latest version, it should work as expected.

Let me know how you get on.

riverrun commented 7 years ago

Did you solve this problem?