27 lines
708 B
Elixir
27 lines
708 B
Elixir
defmodule BasicSignupWhitelist do
|
|
@moduledoc """
|
|
Checks if an email address is allowed based on the SIGNUP_ALLOWED_EMAILS env variable.
|
|
"""
|
|
|
|
@doc """
|
|
Checks if an email address is allowed based on the SIGNUP_ALLOWED_EMAILS env variable.
|
|
|
|
Rules:
|
|
- Returns true if ALLOWED_EMAILS == "*" (all emails allowed)
|
|
- Returns true if email matches any entry in the comma-separated list
|
|
- Returns false if:
|
|
* Environment variable doesn't exist
|
|
* Environment variable is empty string
|
|
* Email not found in whitelist
|
|
|
|
## Examples
|
|
|
|
iex> BasicSignupWhitelist.mail_whitelisted("joe@example.com")
|
|
false
|
|
|
|
"""
|
|
def mail_whitelisted(_email) do
|
|
false
|
|
end
|
|
end
|