addCode method Null safety

  1. @override
Future addCode(
  1. AuthServer server,
  2. AuthCode code
)
override

Must store code.

code must be accessible until its expiration date.

Implementation

@override
Future addCode(AuthServer server, AuthCode code) async {
  final storage = ManagedAuthToken.fromCode(code);
  final query = Query<ManagedAuthToken>(context!)..values = storage;

  await query.insert();

  return pruneTokens(code.resourceOwnerIdentifier);
}