Login por matricula

This commit is contained in:
2024-07-01 12:19:08 -03:00
parent 10b1f8c855
commit b11499ff2d
6 changed files with 32 additions and 34 deletions

View File

@ -44,6 +44,12 @@ defmodule Derivantes.Accounts do
if User.valid_password?(user, password), do: user
end
def get_user_by_matricula_and_password(matricula, password)
when is_binary(matricula) and is_binary(password) do
user = Repo.get_by(User, matricula: matricula)
if User.valid_password?(user, password), do: user
end
@doc """
Gets a single user.

View File

@ -22,19 +22,13 @@ defmodule Derivantes.Accounts.UserNotifier do
Deliver instructions to confirm account.
"""
def deliver_confirmation_instructions(user, url) do
deliver(user.email, "Confirmation instructions", """
deliver(user.email, "Confirme su correo electrónico", """
==============================
Hi #{user.email},
You can confirm your account by visiting the URL below:
Hola #{user.email},
Active su cuenta haciendo click en el siguiente enlace:
#{url}
If you didn't create an account with us, please ignore this.
==============================
""")
end