Closed jagoanmamah closed 4 years ago
Can you post the user_has_been_created
and signed_in
methods you have added?
defmodule MyAppWeb.Pow.Messages do
use Pow.Phoenix.Messages
use Pow.Extension.Phoenix.Messages,
extensions: [PowAssent,PowResetPassword, PowEmailConfirmation]
import MyAppWeb.Gettext
def user_not_authenticated(_conn), do: gettext("Anda harus masuk untuk melihat halaman ini.")
# Message methods for extensions has to be prepended with the snake cased
# extension name. So the `email_has_been_sent/1` method from
# `PowResetPassword` is written as `pow_reset_password_email_has_been_sent/1`
# in your messages module.
def pow_reset_password_email_has_been_sent(_conn), do: gettext("Email dengan instruksi atur ulang kata sandi telah dikirimkan kepada Anda. Silakan periksa kotak masuk Anda.")
def invalid_credentials(_conn), do: gettext("Detail masuk yang disediakan tidak berfungsi. Harap verifikasi identitas Anda, dan coba lagi.")
def user_has_been_created(_conn), do: gettext("Pengguna sudah dibuat.")
def pow_email_confirmation_email_confirmation_required(_conn), do: gettext("Anda harus mengkonfirmasi email Anda sebelum dapat masuk. Tautan konfirmasi email telah dikirimkan kepada Anda.")
def pow_email_confirmation_email_has_been_confirmed(_conn), do: gettext("Alamat email telah dikonfirmasi.")
def pow_reset_password_password_has_been_reset(_conn), do: gettext("Kata sandi telah diperbarui.")
def pow_reset_password_maybe_email_has_been_sent(_conn), do: gettext("Email dengan instruksi atur ulang kata sandi telah dikirimkan kepada Anda. Silakan periksa kotak masuk Anda.")
# def pow_assent_signed_in(conn) do
# provider = Phoenix.Naming.humanize(conn.params["provider"])
# gettext("Anda sudah masuk dengan %{provider}.", provider)
# end
end
If you pull from master branch with {:pow_assent, github: "pow-auth/pow_assent"}
, this should have been resolved.
Hi
I got Dialyzer errors when not overwriting the user_has_been_created/1 and signed_in/1 messages:
Invalid type specification for function 'Elixir.TaskmanWeb.Pow.Messages.PowAssent.Phoenix.Messages':user_has_been_created/1. The success typing is
(_) -> 'nil'
Invalid type specification for function 'Elixir.TaskmanWeb.Pow.Messages.PowAssent.Phoenix.Messages':signed_in/1. The success typing is
(_) -> 'nil'
This is my messages file:
defmodule MyAppWeb.Pow.Messages do
use Pow.Phoenix.Messages
use Pow.Extension.Phoenix.Messages,
extensions: [PowEmailConfirmation, PowPersistentSession, PowResetPassword, PowAssent]
def pow_assent_could_not_sign_in(_conn),
do: "Couldn't sign you in."
end
I'm new at elixir and phoenix, so apologies if I'm doing something wrong.
Sorry for late reply @rompetomp. I found the issue in Pow, and fixed it with https://github.com/danschultzer/pow/pull/520
If you use the master branch with {:pow, github: "danschultzer/pow", override: true}
it should no longer output the warnings. Let me know if that resolves it!