AuthBrowserProtectionOptions class final

Typed browser-request protections shared by framework adapters.

Constructors

AuthBrowserProtectionOptions({bool enabled = true, List<String> allowedOrigins = const <String>[], List<String> trustedOrigins = const <String>[], bool requireOrigin = false, bool enforceFetchMetadata = true, bool enforceReferrer = false, Set<String> allowedMethods = const {'GET', 'POST', 'PUT', 'DELETE', 'PATCH'}, bool requireContentType = false})
Creates browser-request protections with the supplied policy values.
const
AuthBrowserProtectionOptions.production({required Iterable<String> trustedOrigins})
Strict browser policy for a production auth runtime.

Properties

allowedMethods → Set<String>
Allowed HTTP methods for browser requests.
final
allowedOrigins → List<String>
Explicit browser origins allowed to call state-changing auth routes.
final
enabled → bool
Whether adapters should apply browser-request checks.
final
enforceFetchMetadata → bool
Whether adapters should reject Fetch Metadata cross-site requests unless their origin is explicitly allowed.
final
enforceReferrer → bool
Whether to validate the Referer header as a fallback for missing Origin.
final
hashCode → int
The hash code for this object.
no setterinherited
requireContentType → bool
Whether to require Content-Type header on state-changing requests.
final
requireOrigin → bool
Whether a state-changing request must include an Origin header.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
trustedOrigins → List<String>
Trusted origins for CSRF and origin validation.
final

Methods

copyWith({bool? enabled, List<String>? allowedOrigins, List<String>? trustedOrigins, bool? requireOrigin, bool? enforceFetchMetadata, bool? enforceReferrer, Set<String>? allowedMethods, bool? requireContentType}) → AuthBrowserProtectionOptions
Returns a shallow policy copy with supplied values replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

localDevelopment → const AuthBrowserProtectionOptions
Relaxed browser policy for explicitly local development.