Heroku Deloyment error

System

  • Node.js version: 16.13.1
  • NPM version: 8.3,2
  • Strapi version: 4.0.3
  • Database:
  • Operating system: Windows 10 64 bit

Describe the bug

I have deployed my strapi app with nextjs on heroku both frontend and backend on different heroku project with strapi JWT authentication. I also check the expiry date of JWT token on jwt.io it has showing 30 days validity but After deploying heroku app is running only for 1-2 hours after that it showing the API is unauthorized (401) in console and application error at home screen.

Additional context
I also try with API token option that is available in strapi but it has also the same result