GoTrue constructor

GoTrue(
  1. GoTrueInit init
)

Implementation

GoTrue(GoTrueInit init) {
  if (HTTPRegexp.hasMatch(init.APIUrl)) {
    debugPrint(
      'Warning:\n\nDO NOT USE HTTP IN PRODUCTION FOR GOTRUE EVER!\nGoTrue REQUIRES HTTPS to work securely.',
    );
  }
  APIUrl = init.APIUrl;

  if (init.audience != null) {
    audience = init.audience;
  }

  if (ORIGINRegexp.hasMatch(APIUrl)) {
    // eslint-disable-line no-useless-escape
    _sameOrigin = true;
  }

  setCookie = init.setCookie;

  api = Dio(BaseOptions(
    baseUrl: APIUrl,
  ));
}