validateConsentChallenge method

Future<AuthPublicResponse> validateConsentChallenge({
  1. required String challenge,
})

Implementation

Future<SoftcorpGrpc.AuthPublicResponse> validateConsentChallenge(
    {required String challenge}) async {
  if (testMode == true) {
    print("validateConsentChallenge");
  }
  if (mockMode == true) {
    return await Future.delayed(const Duration(seconds: 2)).then((_) {
      return SoftcorpGrpc.AuthPublicResponse()
        ..nameOfUser = "mock-user@softcorp.io"
        ..client = mockApp;
    });
  }
  SoftcorpGrpc.AuthPublicRequest req = SoftcorpGrpc.AuthPublicRequest();
  req.challenge = challenge;
  return client.validateConsentChallenge(req);
}