Error - Your auth code has expired. Please generate a new auth code

Hi All, I am using flutter dart POST call to generate auth code. I was able to generate auth code & refresh token for the first time and i did not save it since i was testing. Now, if i generate it again i am getting “Your auth code has expired. Please generate a new auth code” error. Is there any method to refresh auth code or do i need to delete the app and recreate it? Please guide me.

Hi @ganesh.09br3889
Your auth code has expired. Please generate a new auth code is a error of validate-authcode api which is used to validate a generated authcode
generated using generate-authcode API
please check your code base once if you are by mistake calling validate-authcode API with a hardcoded expired authcode somewhere

Nihal thanks for your reply. But my generate auth code returning me same auth code repeatedly.
I am using below code:

return ‘${‘https://api.fyers.in/api/v2/generate-authcode?client_id=’ + authInfo[‘appid’]}&redirect_uri=https://myapi.fyers.in/dashboard&response_type=code&state=’ + DateTime.now().millisecondsSinceEpoch.toString();

–
Here, i am getting app id from DB.

Hi @ganesh.09br3889 ,

You can create the access token only once using the Auth code. If you want to create the access token again then you have to create Auth code again.

Using the same Auth code , you can not create the access token again.
And Kindly follow the documentation link

Thanks