refactor: centralize SIGNUP_ALLOWLIST_EMAILS constant definition
Define environment variable name as a module attribute in BasicSignupAllowlist and expose it via signup_allowlist_emails/0 function to eliminate duplication across lib and test files. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
defmodule BasicSignupAllowlist do
|
||||
import FunCore.BasicSignupAllowlist
|
||||
|
||||
@signup_allowlist_emails "SIGNUP_ALLOWLIST_EMAILS"
|
||||
|
||||
@moduledoc """
|
||||
Checks if an email address is allowed based on the SIGNUP_ALLOWLIST_EMAILS env variable.
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Returns the name of the environment variable used for the signup allowlist.
|
||||
"""
|
||||
def signup_allowlist_emails, do: @signup_allowlist_emails
|
||||
|
||||
@doc """
|
||||
Checks if an email address is allowed based on the SIGNUP_ALLOWLIST_EMAILS env variable.
|
||||
|
||||
@@ -27,7 +34,7 @@ defmodule BasicSignupAllowlist do
|
||||
|
||||
"""
|
||||
def mail_allowlisted(email) do
|
||||
env_value = System.get_env("SIGNUP_ALLOWLIST_EMAILS")
|
||||
env_value = System.get_env(@signup_allowlist_emails)
|
||||
mail_allowlisted_fun(env_value, email)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user