getAccessTokenFromURL function
Analyze a URL and try to extract an AccessToken from it. @param url The URL to look into.
Implementation
String? getAccessTokenFromURL(dynamic url) {
try {
Uri uri = url is String ? Uri.parse(url) : url;
var query = Uri.tryParse(uri.fragment.startsWith("/")
? uri.fragment.substring(1)
: uri.fragment)
?.queryParameters;
return query?["access_token"];
} catch (e) {
rethrow;
}
}