Base for guards that resolve the user from the current Request: caches per scope, so every call within one request hits the database at most once.
- Implemented types
-
- Guard<
T>
- Guard<
- Implementers
Constructors
-
RequestGuard({required String name, UserProvider<
T> ? provider})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
final
-
provider
→ UserProvider<
T> ? -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
check(
) → Future< bool> -
override
-
forgetUser(
) → void -
Clears the cached user for the current request/scope.
override
-
guest(
) → Future< bool> -
override
-
id(
) → Future< Object?> -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolveUser(
Request request) → Future< T?> -
Resolves the user for
request(nullwhen unauthenticated). -
setUser(
T user) → void -
Sets the user for the current request/scope (tests,
once).override -
toString(
) → String -
A string representation of this object.
inherited
-
user(
) → Future< T?> -
The authenticated user, cached for the current request/scope.
override
-
validate(
Map< String, Object?> credentials) → Future<bool> -
Validates credentials without logging the user in.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited