Egoleo commented on Authentication from Discover Elixir & Phoenix.
Egoleo replied to a comment on Authentication from Discover Elixir & Phoenix.
ok but is it supposed to as a variable? Because this is the error i am getting.
warning: variable "message" does not exist and is being expanded to "message()", please use parentheses to remove the ambiguity or change the variable name
lib/messengyr_web/controllers/page_controller.ex:53: MessengyrWeb.PageController.login_user/2
Egoleo commented on Authentication from Discover Elixir & Phoenix.
WHat is message in this function?
def login_user(conn, %{"credentials" => credentials}) do
case Session.authenticate(credentials) do
{:ok, %{username: username}} ->
conn
|> put_flash(:info, "Logged in as #{username}!")
|> render("login.html")
{:error, message} ->
conn
|> put_flash(:error, message)
|> render("login.html")
end
end
Egoleo replied to a comment on Building our first pages from Discover Elixir & Phoenix.
Resolved. I had to change
<%= link "", class: "logo", to: page_path(@conn, :index) %>
<%= link "Log in", to: page_path(@conn, :login) %>
to
Egoleo
I am getting the below error with your code.
[error] #PID<0.551.0> running MessengyrWeb.Endpoint (connection #PID<0.543.0>, stream id 4) terminated
Server: localhost:4000 (http)
Request: POST /login
** (exit) an exception was raised:
** (ArgumentError) Comeonin.Bcrypt.checkpw has been removed.
Add {:bcrypt_elixir, "~> 2.0"} to the deps in your mix.exs file,
and use Bcrypt.verify_pass instead.
So i tried below code but still getting issues with it.
Any ideas?