ssoLogin method
Implementation
Future<Map<String, dynamic>> ssoLogin(
{required String url,
required String scheme,
String error = "User have canceled the process"}) async {
try {
final result = await FlutterWebAuth.authenticate(
url: url, callbackUrlScheme: scheme, preferEphemeral: true);
final token = Uri.parse(result).queryParameters['code'];
return {'token': token}; // Returns the API response
} catch (_) {
return {"error": error};
}
}