getAuthrorisationCode method

Future<Map<String, dynamic>?> getAuthrorisationCode(
  1. dynamic responseUri
)

Implementation

Future<Map<String, dynamic>?> getAuthrorisationCode(responseUri) async {
  Map<String, dynamic>? userData;
  //EasyLoading.show();
  print("responseUri $responseUri");
  final String? code = responseUri.queryParameters["code"];
  //getUserProfile(code!);
  if (code != null) {
    print("Authorization Code: $code");
    userData = await exchangeCodeForToken(flowName: user_flow, code: code);
    userData["curruent_user_flow"] = user_flow;
    // save token to secure storage
  } else {
    userData = null;
    print("Error: Authorization code not received.");
  }
  return userData;
}