AuthUser class

Authenticated user profile used by auth flows and sessions.

Constructors

AuthUser({required String id, String? email, String? name, String? image, List<String> roles = const <String>[], bool isAnonymous = false, Map<String, dynamic>? attributes})
AuthUser.fromJson(Map<String, dynamic> json)
Creates a user from a JSON payload.
factory
AuthUser.fromPrincipal(AuthPrincipal principal)
Creates a user from a session principal.
factory

Properties

attributes Map<String, dynamic>
Additional provider-specific attributes.
final
email String?
Primary email address.
final
hashCode int
The hash code for this object.
no setterinherited
id String
Provider-stable user identifier.
final
image String?
Avatar or profile image URL.
final
isAnonymous bool
Whether this account has no verified authentication identity yet.
final
name String?
Display name.
final
roles List<String>
Role labels used by guards and gates.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
redacted() AuthUser
Creates a user safe to retain in events and audit records.
toJson() Map<String, dynamic>
Converts this user to JSON for API responses.
toPrincipal() AuthPrincipal
Converts this user to a session principal.
toString() String
A string representation of this object.
inherited

Operators

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