auth method

void auth({
  1. required String source,
  2. required String operation,
  3. String? userId,
  4. String? provider,
  5. bool? success,
  6. Object? error,
  7. Duration? duration,
  8. Map<String, Object?>? meta,
  9. ISpectTraceConfig? config,
  10. String? correlationId,
})

Logs a one-shot auth event without awaiting a future.

Use when the operation isn't structured as a Future (e.g. logging an already-completed result, emitting a breadcrumb, or recording failure from a callback).

Implementation

void auth({
  required String source,
  required String operation,
  String? userId,
  String? provider,
  bool? success,
  Object? error,
  Duration? duration,
  Map<String, Object?>? meta,
  ISpectTraceConfig? config,
  String? correlationId,
}) {
  if (!isEnabled) return;
  traceCategory(
    category: authCategory,
    source: source,
    operation: operation,
    success: success,
    error: error,
    duration: duration,
    meta: boundedTraceMeta(
      fields: {
        if (userId != null) 'userId': userId,
        if (provider != null) 'provider': provider,
      },
      overrides: meta,
    ),
    config: config,
    correlationId: correlationId,
  );
}