removeTokens method

  1. @override
Future removeTokens(
  1. AuthServer server,
  2. int resourceOwnerID
)
override

This method must delete all AuthToken and AuthCodes for a ResourceOwner.

server is the requesting AuthServer. resourceOwnerID is the ResourceOwner.id.

Implementation

@override
Future removeTokens(AuthServer server, int resourceOwnerID) {
  final tokenQuery = Query<ManagedAuthToken>(context)
    ..where((o) => o.resourceOwner).identifiedBy(resourceOwnerID);

  return tokenQuery.delete();
}