AuthToken constructor

AuthToken({
  1. String? ipAddress,
  2. num lifeSpan = -1,
  3. required String userId,
  4. DateTime? issuedAt,
  5. Map<String, dynamic>? payload,
})

Implementation

AuthToken(
    {this.ipAddress,
    this.lifeSpan = -1,
    required this.userId,
    DateTime? issuedAt,
    Map<String, dynamic>? payload}) {
  this.issuedAt = issuedAt ?? DateTime.now();
  if (payload != null) {
    this.payload.addAll(payload.keys
            .fold({}, ((out, k) => out?..[k.toString()] = payload[k])) ??
        {});
  }
}