validateCallbackUrl static method

bool validateCallbackUrl(
  1. String callbackUrl,
  2. String expectedScheme
)

Validates that a callback URL matches the expected redirect URI

Implementation

static bool validateCallbackUrl(String callbackUrl, String expectedScheme) {
  final uri = Uri.tryParse(callbackUrl);
  if (uri == null) return false;

  return uri.scheme.toLowerCase() == expectedScheme.toLowerCase();
}