Packages
phauxth
2.0.0-rc.2
2.5.1
retired
2.5.0
2.4.0
2.3.2
2.3.1
2.3.0
2.2.0
2.1.1
2.1.0
2.0.1
2.0.0
2.0.0-rc.2
2.0.0-rc.1
2.0.0-rc.0
2.0.0-beta.1
2.0.0-beta.0
2.0.0-alpha.5
2.0.0-alpha.4
retired
2.0.0-alpha.3
retired
2.0.0-alpha.2
retired
2.0.0-alpha.1
retired
2.0.0-alpha.0
retired
1.2.9
1.2.8
1.2.7
1.2.6
1.2.5
1.2.4
1.2.3
1.2.1
1.2.0
1.1.3
1.1.2
1.1.1
1.1.0
1.0.3
1.0.2
1.0.1
1.0.0
0.17.1
0.17.0
0.16.0
0.15.1
0.15.0
0.14.0
0.13.0-rc.1
0.13.0-rc.0
0.12.1-rc.1
0.12.1-rc.0
0.12.0-rc
0.11.0
0.10.3
0.10.2
0.10.0
0.9.0
0.8.2
0.8.1
0.8.0
Authentication library for Phoenix, and other Plug-based, web applications
Current section
Files
Jump to
Current section
Files
lib/phauxth/user_messages.ex
defmodule Phauxth.UserMessages.Base do
@moduledoc """
Customizable module to be used to display messages to users.
These messages can be customized to display different messages or
add translations using gettext.
## Custom messages
The following module is a basic example of how to translate the
user messages that Phauxth outputs:
defmodule MyApp.UserMessages do
use Phauxth.UserMessages.Base
import MyApp.Gettext
def default_error, do: gettext "Invalid credentials"
end
"""
@callback already_confirmed() :: String.t()
@callback default_error() :: String.t()
@callback invalid_token() :: String.t()
defmacro __using__(_) do
quote do
@behaviour Phauxth.UserMessages.Base
def already_confirmed, do: "Your account has already been confirmed"
def default_error, do: "Invalid credentials"
def invalid_token, do: "Invalid token"
defoverridable Phauxth.UserMessages.Base
end
end
end
defmodule Phauxth.UserMessages do
use Phauxth.UserMessages.Base
end