smpallen99 / coherence

Coherence is a full featured, configurable authentication system for Phoenix
MIT License
1.27k stars 225 forks source link

0.5.0 - Error during `/passwords/new` #348

Closed jdobrzanski closed 6 years ago

jdobrzanski commented 6 years ago
Request: GET /passwords/new
** (exit) an exception was raised:
    ** (ArgumentError) argument error
        :erlang.apply(Lol.Accounts.User, {Lol.Accounts.User, :changeset}, [])
        (coherence) lib/coherence/controllers/controller_helpers.ex:284: Coherence.ControllerHelpers.changeset/4
        (lol) lib/lol_web/controllers/coherence/password_controller.ex:35: LolWeb.Coherence.PasswordController.new/2

I have set my config with changeset: {Lol.Accounts.User, :changeset} and have the changeset function on my Lol.Accounts.User model:

  def changeset(model, params, :password) do
    model
    |> cast(params, ~w(password password_confirmation reset_password_token reset_password_sent_at))
    |> validate_coherence_password_reset(params)
  end
jdobrzanski commented 6 years ago

Solved - removed the config line changeset: {Lol.Accounts.User, :changeset} and let the controllerhelper stick to the default value :changeset.