Closed dbi1 closed 4 years ago
If your server was running while you ran the generator, that is to be expected. phx.gen.auth
injects some dependencies in your project's mix.exs
file, which requires the phoenix server to be restarted before a page can be loaded again.
Hmm, oddly I wasn't doing anything. I ran the generator before I started the server, but pretty sure not while it was running...
The last thing it shows in the Phoenix server log before showing the above error was a successful query:
[info] GET /users/settings
[debug] Processing with MyAppWeb.UserSettingsController.edit/2
Parameters: %{}
Pipelines: [:browser, :require_authenticated_user]
[debug] QUERY OK source="users_tokens" db=1.0ms idle=806.2ms
SELECT u1."id", u1."email", u1."hashed_password", u1."confirmed_at", u1."inserted_at", u1."updated_at" FROM "users_tokens" AS u0 INNER JOIN "users" AS u1 ON u1."id" = u0."user_id" WHERE ((u0."token" = $1) AND (u0."context" = $2)) AND (u0."inserted_at" > $3::timestamp + (-60::decimal::numeric * interval '1 day')) [<<list of numbers redacted out>>, "session", ~U[2020-11-12 14:28:50.903010Z]]
[info] Sent 200 in 2ms
The error is correct. You have to restart the server if you or anything touched the mix.exs file.
Got it, thank you!
Hi again,
after installing
make
I successfully installed / ran the auth generator, and have been playing around with the auth functionality via the UI.I successfully registered a user and changed the associated email address. Then, after letting the page sit for a while I came back to it, tried to change the email address again (if I remember correctly), and got the following error:
Restarting the Phoenix server (without changing any files) fixed the problem (for now) and all seems to be working again.
My Elixir version is 1.11.2
Any idea what might be going on?
Thanks!