AuthGuard class

Guard that checks if the user is authenticated.

You must import AuthModule in the module using this guard.

Inheritance
  • Object
  • Middleware<ModularArguments>
  • AuthGuard

Constructors

AuthGuard({String? redirectTo})
Guard that checks if the user is authenticated.

Properties

hashCode int
The hash code for this object.
no setterinherited
redirectTo String?
If the route is not allowed then the Guard will redirect to that route.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

canActivate(String path, ModularRoute route) Future<bool>
Returns a FutureOr. If true, allow the route to continue processing. If it is false, the Guard will try to redirect the route. If there is no redirect then an error will be thrown GuardedRouteException.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pos(ModularRoute route, ModularArguments data) FutureOr<ParallelRoute?>
Method called as soon as route is found and after settings.
inherited
pre(ModularRoute route) FutureOr<ModularRoute?>
Method called as soon as route is found and before settings.
inherited
toString() String
A string representation of this object.
inherited

Operators

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