mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
add missing session-related links (philomena-dev/philomena#23)
This commit is contained in:
parent
9fbff24bd7
commit
f01a9cf20b
2 changed files with 16 additions and 6 deletions
|
@ -20,9 +20,11 @@ defmodule PhilomenaWeb.SessionController do
|
|||
|
||||
cond do
|
||||
not is_nil(user) and is_nil(user.confirmed_at) ->
|
||||
conn
|
||||
|> put_flash(:error, "You must confirm your account before logging in.")
|
||||
|> redirect(to: "/")
|
||||
render(
|
||||
conn,
|
||||
"new.html",
|
||||
error_message: "You must confirm your account before logging in."
|
||||
)
|
||||
|
||||
not is_nil(user) ->
|
||||
conn
|
||||
|
@ -30,7 +32,12 @@ defmodule PhilomenaWeb.SessionController do
|
|||
|> UserAuth.log_in_user(user, user_params)
|
||||
|
||||
true ->
|
||||
render(conn, "new.html", error_message: "Invalid email or password")
|
||||
render(
|
||||
conn,
|
||||
"new.html",
|
||||
error_message:
|
||||
"Invalid email or password. If you're seeing this more than usual, your account may be locked."
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@ h1 Sign in
|
|||
= if @error_message do
|
||||
.alert.alert-danger
|
||||
p = @error_message
|
||||
p = link "Resend unlock instructions", to: Routes.unlock_path(@conn, :new)
|
||||
p = link "Resend confirmation email", to: Routes.confirmation_path(@conn, :new)
|
||||
|
||||
p = link "Forgot your password?", to: Routes.password_path(@conn, :new)
|
||||
|
||||
|
@ -16,10 +18,11 @@ h1 Sign in
|
|||
= error_tag f, :password
|
||||
|
||||
.field
|
||||
= checkbox f, :remember_me
|
||||
=> checkbox f, :remember_me
|
||||
= label f, :remember_me, "Remember me"
|
||||
|
||||
= submit "Sign in", class: "button"
|
||||
.actions
|
||||
= submit "Sign in", class: "button"
|
||||
|
||||
p
|
||||
strong
|
||||
|
|
Loading…
Reference in a new issue