Invalid auth token new blynk

hello everyone
i am facing a problem and i need your help
i was using the old blynk app and everything was ok when i upgrade the code with the
new parametres i cant connect to the server, i take invalid auth token .

/*

  Blynk Flow Sensor Water Meter- Calculates Total Water Consumption.

  Source: https://github.com/pkarun/Blynk-Flow-Sensor-Water-Meter

*/


#define BLYNK_PRINT Serial           // Uncomment for debugging
#define BLYNK_TEMPLATE_ID "TMPLTeFN6BIo"
#define BLYNK_DEVICE_NAME "water control tserapi"
#include "settings.h" 
#include "secret.h"                   // <<--- UNCOMMENT this before you use and change values on config.h tab
//#include "my_secret.h"              // <<--- COMMENT-OUT or REMOVE this line before you use. This is my personal settings.

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

#include <ESP8266mDNS.h>  // For OTA with ESP8266
#include <WiFiUdp.h>  // For OTA
#include <ArduinoOTA.h>  // For OTA

BlynkTimer timer;

volatile long pulseCount = 0;
float flowRate;
unsigned int flowMilliLitres;
unsigned long totalMilliLitres;
float totalLitres;
float totalLitresold;
unsigned long oldTime;


BLYNK_CONNECTED() { // runs once at device startup, once connected to server.

  Blynk.syncVirtual(VPIN_TOTAL_LITERS); //gets last know value of V1 virtual pin

}


// Restores last know value of V1 virtual pin which we got it from blynk server
BLYNK_WRITE(VPIN_TOTAL_LITERS)
{
  totalLitresold = param.asFloat();

}


BLYNK_WRITE(VPIN_RESET) {  // reset all data with button in PUSH mode on virtual pin V4
  int resetdata = param.asInt();
  if (resetdata == 0) {
    Serial.println("Clearing Data");
    Blynk.virtualWrite(VPIN_TOTAL_LITERS, 0);
    Blynk.virtualWrite(VPIN_FLOW_RATE, 0);
    flowRate = 0;
    flowMilliLitres = 0;
    totalMilliLitres = 0;
    totalLitres = 0;
    totalLitresold = 0;
  }
}



void pulseCounter()
{
  pulseCount++;
}

void flow()
{

  if ((millis() - oldTime) > 1000)   // Only process counters once per second
  {
    detachInterrupt(PULSE_PIN);
    flowRate = ((1000.0 / (millis() - oldTime)) * pulseCount) / FLOW_CALIBRATION;
    oldTime = millis();
    flowMilliLitres = (flowRate / 60) * 1000;
    totalMilliLitres += flowMilliLitres;
    totalLitres = totalLitresold + totalMilliLitres * 0.001;
    unsigned int frac;

    // Print the flow rate for this second in liters / minute
    Serial.print("flowrate: ");
    Serial.print(int(flowRate));  // Print the integer part of the variable

    Serial.print(".");             // Print the decimal point
    frac = (flowRate - int(flowRate)) * 10; // Determine the fractional part. The 10 multiplier gives us 1 decimal place.
    Serial.print(frac, DEC) ;      // Print the fractional part of the variable
    Serial.print("L/min");

    Serial.print("  Current Liquid Flowing: ");  // Print the number of liters flowed in this second
    Serial.print(flowMilliLitres);
    Serial.print("mL/Sec");

    Serial.print("  Output Liquid Quantity: ");  // Print the cumulative total of liters flowed since starting
    Serial.print(totalLitres);
    Serial.println("L");

    pulseCount = 0;  // Reset the pulse counter so we can start incrementing again

    attachInterrupt(PULSE_PIN, pulseCounter, FALLING);    // Enable the interrupt again now that we've finished sending output
  }

}


void sendtoBlynk()  // In this function we are sending values to blynk server
{
  Blynk.virtualWrite(VPIN_TOTAL_LITERS, totalLitres);          // Total water consumption in liters (L)
  Blynk.virtualWrite(VPIN_FLOW_RATE, flowRate);            // Displays the flow rate for this second in liters / minute (L/min)
  //  Blynk.virtualWrite(VPIN_FLOW_RATE, flowMilliLitres);  // Displays the number of liters flowed in second (mL/Sec)

}

void setup()
{
  Serial.begin(57600);
  Blynk.begin(AUTH, WIFI_SSID, WIFI_PASS);
  ArduinoOTA.setHostname(OTA_HOSTNAME);  // For OTA - Use your own device identifying name
  ArduinoOTA.begin();  // For OTA

  pulseCount        = 0;
  flowRate          = 0.0;
  flowMilliLitres   = 0;
  totalMilliLitres  = 0;
  oldTime           = 0;
  totalLitresold = 0;

  pinMode(PULSE_PIN, INPUT);  // Initialization of the variable "PULSE_PIN" as INPUT (D2 pin)

  attachInterrupt(PULSE_PIN, pulseCounter, FALLING);

  timer.setInterval(10000L, sendtoBlynk); // send values blynk server every 10 sec

}


void loop()
{

  Blynk.run();
  ArduinoOTA.handle();  // For OTA
  timer.run();
  flow();

}

the code isnt mine i just used it

thank you

@Teo_Efraimidis I’be deleted your unformatted code because it had so many formatting issues that it will be easier for you to simply edit your first post and re-insert your code with triple backticks at the beginning and end.
Triple backticks look like this:
```

Do not use block quotes or other characters, juts the triple backticks that I’ve provided for you to copy/paste

Pete.

@PeteKnight thank you pete i done it just like you suggested.

What’s in settings.h and secret.h ?

The code you’ve copied is a mess. It calls a function from the void loop which then does some millis comparison to run once per second, instead of using a BlynkTimer to do that instead. That probably won’t give good results with Blynk.

In addition, the interrupt is being attached and re-attached every time, instead of being suspended and reinstated with a noInterrupts and interrupts command.
Also, your interrupt service routine isn’t declared in IRAM so won’t work with the latest ESP core.

Pete.

hello pete thanks for quick reply

                           /////////////////////////////////////////////////////////////////
                          //                           Settings                          //
                         /////////////////////////////////////////////////////////////////

                         

/***************************************************
 *      Hardware Settings
 **************************************************/

#define PULSE_PIN D2  //gpio4


/***************************************************
 *        Variable Settings
 **************************************************/

#define FLOW_CALIBRATION 8.2 
 

/***************************************************
 *        Blynk Virtual Pin Assignment
 **************************************************/

#define VPIN_TOTAL_LITERS       V1
#define VPIN_FLOW_RATE          V2
#define VPIN_FLOW_MILLI_LITERS  V3
#define VPIN_RESET              V4

/***************************************************
 *        Server Settings
 **************************************************/
      
#define OTA_HOSTNAME "Test Flow Sensor Water Meter"```


//////////////////////////////////////////////////////////// 
//             Secret Configuration                      //
////////////////////////////////////////////////////////// 

/***************************************************
         Blynk Settings
 **************************************************/

#define AUTH ""                            // You should get Auth Token in the Blynk App.  

/***************************************************
          WiFi Settings
 **************************************************/

#define WIFI_SSID ""                                    
#define WIFI_PASS ""
/***************************************************
          Server Settings
 **************************************************/

//#define SERVER "xxx.xxx.xx.xxx"                                 // Comment-out if use Blynk hosted cloud service

#define PORT 8080

thats the secret.h and settings.h

i didint whote the code i tried to remove the flow(); out of the loop but i didint connect to the server
is there any threat tha could be help me to correct the code?

thank you Pete