anchor.diff:      s := ARequestInfo.RawHTTPCommand.Split([' ']);
       pm := TParseMap.create(s[1].Substring(6));
       try
  -      FAuthCode := pm.GetVar('code');
         FFinalState := pm.GetVar('state');
  +      if pm.getVar('error') <> '' then
  +        FErrorMessage := pm.getVar('error')
  +      else
  +        FAuthCode := pm.GetVar('code');
         State := stDone;
       finally
         pm.free;
  
positive.code: 
    // called by a client to login via Smart App Launch
    // launches the user's referred browser, and waits for the cycle to complete
    TSmartLoginState = (stStarting, stDone, stComplete);
    TIdleEvent = procedure(out stop : boolean) of object;
    TOpenURLEvent = procedure(url : String) of object;
    TSmartAppLaunchLogin = class (TAdvObject)
  
negative.code:     FOnOpenURL: TOpenURLEvent;
      Fversion: String;
      FName: String;
      FErrorMessage : String;
  
      procedure SetServer(const Value: TRegisteredFHIRServer);
      procedure Settoken(const Value: TSmartOnFhirAccessToken);
  