fix registration email
This commit is contained in:
@@ -4,10 +4,10 @@ defmodule Cannery.Accounts do
|
||||
"""
|
||||
|
||||
import Ecto.Query, warn: false
|
||||
alias Cannery.Repo
|
||||
alias Cannery.{Mailer, Repo}
|
||||
alias Cannery.Accounts.{User, UserToken}
|
||||
alias Cannery.Mailer
|
||||
alias Ecto.{Changeset, Multi}
|
||||
alias Oban.Job
|
||||
|
||||
## Database getters
|
||||
|
||||
@@ -202,8 +202,7 @@ defmodule Cannery.Accounts do
|
||||
{:ok, %{to: ..., body: ...}}
|
||||
|
||||
"""
|
||||
@spec deliver_update_email_instructions(User.t(), String.t(), function) ::
|
||||
{:ok, any()} | {:error, atom()}
|
||||
@spec deliver_update_email_instructions(User.t(), String.t(), function) :: Job.t()
|
||||
def deliver_update_email_instructions(user, current_email, update_email_url_fun)
|
||||
when is_function(update_email_url_fun, 1) do
|
||||
{encoded_token, user_token} = UserToken.build_email_token(user, "change:#{current_email}")
|
||||
@@ -319,8 +318,7 @@ defmodule Cannery.Accounts do
|
||||
{:error, :already_confirmed}
|
||||
|
||||
"""
|
||||
@spec deliver_user_confirmation_instructions(User.t(), function) ::
|
||||
{:ok, any()} | {:error, atom()}
|
||||
@spec deliver_user_confirmation_instructions(User.t(), function) :: Job.t()
|
||||
def deliver_user_confirmation_instructions(user, confirmation_url_fun)
|
||||
when is_function(confirmation_url_fun, 1) do
|
||||
if user.confirmed_at do
|
||||
@@ -367,8 +365,7 @@ defmodule Cannery.Accounts do
|
||||
{:ok, %{to: ..., body: ...}}
|
||||
|
||||
"""
|
||||
@spec deliver_user_reset_password_instructions(User.t(), function()) ::
|
||||
{:ok, any()} | {:error, atom()}
|
||||
@spec deliver_user_reset_password_instructions(User.t(), function()) :: Job.t()
|
||||
def deliver_user_reset_password_instructions(user, reset_password_url_fun)
|
||||
when is_function(reset_password_url_fun, 1) do
|
||||
{encoded_token, user_token} = UserToken.build_email_token(user, "reset_password")
|
||||
|
||||
Reference in New Issue
Block a user