getDefaultGuard method

  1. @override
String getDefaultGuard()
override

Gets the default guard name

Returns the default guard name

Implementation

@override
String getDefaultGuard() {
  final config = _getAuthConfig();
  final defaults = config['defaults'] as Map<String, dynamic>?;
  final defaultGuard =
      defaults?['guard'] as String? ?? config['default'] as String?;

  if (defaultGuard == null) {
    throw NotFoundException(
      'No default guard specified in authentication configuration.',
    );
  }

  return defaultGuard;
}