giveConsent method

Future<AuthPublicResponse> giveConsent({
  1. required String challenge,
  2. required bool consent,
})

Implementation

Future<SoftcorpGrpc.AuthPublicResponse> giveConsent(
    {required String challenge, required bool consent}) async {
  if (testMode == true) {
    print("giveConsent");
  }
  if (mockMode == true) {
    return await Future.delayed(const Duration(seconds: 2)).then((_) {
      return SoftcorpGrpc.AuthPublicResponse()
        ..redirectAddr = "http://localhost:3050/success";
    });
  }
  SoftcorpGrpc.AuthPublicRequest req = SoftcorpGrpc.AuthPublicRequest();
  req.challenge = challenge;
  req.consent = consent;
  return client.giveConsent(req);
}