apply method

Future<String> apply(
  1. AuthMode mode, {
  2. String? factor,
  3. Duration? duration,
  4. Context? ctx,
})

Implementation

Future<String> apply(
  AuthMode mode, {
  String? factor,
  Duration? duration,
  Context? ctx,
}) async {
  await ready();
  final token = await _tokenizer.apply(
    factor?.isNotEmpty == true ? factor! : mode.wireName,
    duration ?? const Duration(minutes: 5),
    ctx: ctx,
  );
  if (token?.isEmpty ?? true) {
    throw Status.unauthorized.err();
  }
  return token!;
}