Recurrent error jwt expired

Hi team,

I’ve had a minor problem in my Forest environment for months (but I haven’t had time to deal with it before).

My users have an authentication error that recurs.
I think it’s linked to a token expiry, because I’ve spotted the following error in the logs:

Unauthorized: Forest cannot authenticate the user for this request.
    at Immediate.<anonymous> (....\forest-admin\node_modules\forest-express\dist\services\auth.js:38:19)
    at process.processImmediate (node:internal/timers:480:21)

[forest] 🌳🌳🌳  undefined
{
  "code": "invalid_token",
  "status": 401,
  "name": "UnauthorizedError",
  "inner": {
    "name": "TokenExpiredError",
    "message": "jwt expired",
    "expiredAt": "2024-09-24T11:06:15.000Z"
  }
}

I I’m not a programming pro, and I couldn’t find anything about this error in the documentation.

However, it seems to me that the token is managed by forest-express-sequelize, so why am I having this problem?

Can you please help me solve this problem?

Thanks in advance

My current set up is the following one:

  "meta": {
    "liana": "forest-express-sequelize",
    "liana_version": "9.3.28",
    "stack": {
      "database_type": "multiple",
      "engine": "nodejs",
      "engine_version": "20.10.0",
      "orm_version": "6.37.3"
    }
  }

Hi team,

Could you please help me?

Thanks in advance
Louis-Marie

Hello @Louis-Marie,

Could you please share some more context about your issue, following the template below:

  • Project name: …
  • Team name: …
  • Environment name: …
  • Agent technology: (nodejs, php, rails, python)
  • Agent (forest package) name & version: …
  • Database type: …
  • Recent changes made on your end if any: …

We would also need to know some details about how the authentication issue occurs:
Are your users able to login at all ?
If so, when does the error occur ? after a certain delay ? After being inactive for a while ?
Do you have any auto logout settings enabled ?
How do your users connect to the project ? using email+password ? google auth ? SSO ?
Does it happen to all users ? Or only for a some of them ?

in my Forest environment

I’m guessing you mean your prod environment. Does it also happen for your dev or local environments ?

Thanks for those details,

@Nicolas.M

Hi @Nicolas.M

It doesn’t seem to be a known issue, so, obviously, I need to gather more information.

I will try to collect this information and come back to you as soon as I can.

Thank you
Louis-Marie

1 Like

Thanks for your feedback.
Please let us know once you manage to gather more info.