JwtSession class

JWT based session manager.

Use io to configure how session data is transported. Built-in options are:

  1. SessionIoCookie: Stores token in cookie
  2. SessionIoAuthHeader: Stores token in authorization header
  3. SessionIoHeader: Stores token in header

By default, JwtSession uses SessionIoAuthHeader.

server() async {
  final server = Jaguar(sessionManager: JwtSession(jwtConfig));
  // Add routes here
  await server.serve();
}
Implemented types

Constructors

JwtSession(ExpressJwtConfig config, {ExpressJwtValidationConfig? validationConfig, SessionIo io = const SessionIoAuthHeader()})

Properties

coder ExpressJwtMap
final
hashCode int
The hash code for this object.
no setterinherited
io SessionIo
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
parse(ExpressRequest? context) Future<Session>
Parses session from the given request
override
toString() String
A string representation of this object.
inherited
write(ExpressResponse? context, ExpressRequest? req) FutureOr<void>
Writes response with session details
override

Operators

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