create static method

AccessToken create({
  1. required BuildContext context,
  2. required String userId,
  3. Map<String, dynamic>? additional,
  4. required String subject,
  5. required String deviceID,
  6. DateTime? expire,
})

Implementation

static AccessToken create({
  required BuildContext context,
  required String userId,
  Map<String, dynamic>? additional,
  required String subject,
  required String deviceID,
  DateTime? expire,
}) {
  return AccessToken._(
    userId: userId,
    additional: additional,
    issuedAtDate: DateTime.now(),
    issuer: context.owner.serviceRootName,
    tokenID: getRandomId(12),
    subject: subject,
    expireDate: expire,
  );
}