An optional comma-separated list of glob patterns restricting which addresses may register, applied on top of APP_ALLOW_REGISTRATION. A non-matching new address is silently ignored exactly like registration being off; an address that already has an account can still sign in. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,8 @@ final class Config
|
||||
public readonly bool $displayErrors,
|
||||
/** When false, POST /auth/magic-link only signs existing users in -- it never creates a new account. */
|
||||
public readonly bool $allowRegistration,
|
||||
/** Optional glob-pattern gate on which addresses may create an account. Empty => no restriction. */
|
||||
public readonly EmailAllowlist $emailAllowlist,
|
||||
/** Base URL of the frontend, used to build magic links. */
|
||||
public readonly string $appUrl,
|
||||
/** WebAuthn relying party ID -- the domain a passkey is bound to. */
|
||||
@@ -51,6 +53,7 @@ final class Config
|
||||
$jwtTtl = (int) (self::env('JWT_TTL') ?? '86400');
|
||||
$displayErrors = filter_var(self::env('APP_DEBUG', 'false'), FILTER_VALIDATE_BOOL);
|
||||
$allowRegistration = filter_var(self::env('APP_ALLOW_REGISTRATION', 'true'), FILTER_VALIDATE_BOOL);
|
||||
$emailAllowlist = EmailAllowlist::fromString(self::env('APP_EMAIL_ALLOWLIST'));
|
||||
|
||||
$appUrl = rtrim(self::env('APP_URL', 'http://localhost:5173'), '/');
|
||||
|
||||
@@ -86,6 +89,7 @@ final class Config
|
||||
$jwtTtl,
|
||||
$displayErrors,
|
||||
$allowRegistration,
|
||||
$emailAllowlist,
|
||||
$appUrl,
|
||||
$webauthnRpId,
|
||||
$webauthnRpName,
|
||||
|
||||
Reference in New Issue
Block a user