validateUserCredentials method

Future<AuthPublicResponse> validateUserCredentials({
  1. required String challenge,
  2. required String email,
  3. required String password,
})

Implementation

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