getAuthCodeFromUrl static method

String? getAuthCodeFromUrl(
  1. String url
)

Extracts the authentication code from a URL.

Returns null if the 'code' parameter is not present or if the URL is invalid.

Implementation

static String? getAuthCodeFromUrl(String url) {
  try {
    final uri = Uri.parse(url);
    return HamugaIdResponse.fromUri(uri).code;
  } catch (_) {
    return null;
  }
}