Hello there! Sometimes I get an error that is trig...
# support-questions-legacy
j
Hello there! Sometimes I get an error that is triggered during session check:
Copy code
if (resp.headersSent) {
      throw new STError({
        message: 'RESPONSE_SENT',
        type: 'RESPONSE_SENT',
      });
    }
(from the NestJS guide) It seems to happen when session is getting old (like an hour). Why is this check there? When could it happen?
r
hey @jam_nside this happens when the access token has expired. In this case, our middleware sends a response directly to the client, and thats why we have this.
j
Alright, makes sense. How to gracefully handle this case to ask for a relogin?
r
the frontend sdk should try and refresh on its own
if our interceptors are used
if thats not happening, check this list
j
Thank you rp. For the record, my mistake was that I had a catch-everything NestJS filter below the SupertokensExceptionFilter, while it needs to be declared first (counter-intuitive according to me, but hey): https://docs.nestjs.com/exception-filters#catch-everything So my filter was catching SupertokensErrors instead of going through the expected errorHandler.
r
right. I see. Okay, thanks for the info
2 Views