avi.f
03/27/2024, 7:48 PMresponse.headersSent
is true and the user get redirected to login.
So I guess that the verifySession is failed but i dont have info why it was failed even though the original login was successfull.
the err is not set:
await verifySession()(request, response, (res) => {
err = res;
});
how can I debug and understand why am i getting redirected to login page?
Thanksrp_st
03/28/2024, 5:10 AMavi.f
03/28/2024, 5:55 PMcom.supertokens {t: "2024-03-28T17:53:22.755Z", message: "middleware: Not handling because request path did not start with config path. Request path: /api/feed-proxy", file: "/home/avi/work/react-with-nestjs/node_modules/.pnpm/supertokens-node@16.6.5/node_modules/supertokens-node/lib/build/supertokens.js:152:26" sdkVer: "16.6.5"} +0ms
if I enter the wrong credencials, i get "Incorrect email and password combination" as expected.
I am reminding the on the server side the login is successful. but I get the RESPONSE_SENT without any meaningful info.
this is how I init:
supertokens.init({
debug: true,
supertokens: {
connectionURI: process.env.SUPER_TOKENS_BASE_URL,
apiKey: 'test',
},
appInfo: {
appName: 'Test',
apiDomain: tenant-1.com
,
websiteDomain: tenant-1.com
,
apiBasePath: '/auth',
websiteBasePath: '/',
},
....rp_st
03/28/2024, 6:19 PMrp_st
03/28/2024, 6:20 PMavi.f
03/28/2024, 6:33 PMrp_st
03/28/2024, 6:47 PMrp_st
03/28/2024, 6:48 PMavi.f
03/28/2024, 6:51 PMrp_st
03/28/2024, 6:52 PMavi.f
03/28/2024, 6:56 PMexport class AllExceptionsFilterImpl implements ExceptionFilter {
private readonly logger = new Logger(AllExceptionsFilterImpl.name);
constructor() {}
catch(error: any | Error, host: ArgumentsHost) {
console.log('error', error);
const ctx = host.switchToHttp();
const resp = ctx.getResponse();
if (resp.headersSent) {
return;
}
let code;
const res: any = {};
const httpRes = host.switchToHttp().getResponse();
let data = '';
try {
const log = error;
if (error.message) {
log.message = error.message;
log.stack = error.stack;
}
this.logger.error(JSON.stringify(log));
let message = '';
if (error instanceof WebError) {
code = error.responseCode;
message = error.message;
}
if (error.response) {
code = error.response.statusCode || error.response.status;
data = error.response.errors;
message = error.response.message;
}
res.data = data;
res.errorMessage = message;
res.errorStack = error.stack;
} catch (e) {
this.logger.error(e, { message: 'Error in error interceptor' });
}
httpRes.status(code || HttpStatus.INTERNAL_SERVER_ERROR).json(res || {});
}
}
avi.f
03/28/2024, 6:56 PMrp_st
03/28/2024, 6:57 PM@Catch(STError)
annotaion on top of this class?rp_st
03/28/2024, 6:57 PMrp_st
03/28/2024, 6:58 PMavi.f
03/28/2024, 6:59 PMrp_st
03/28/2024, 6:59 PMrp_st
03/28/2024, 7:00 PMavi.f
03/28/2024, 7:00 PMrp_st
03/28/2024, 7:00 PMrp_st
03/28/2024, 7:01 PMavi.f
03/28/2024, 7:01 PMrp_st
03/28/2024, 7:01 PMavi.f
03/28/2024, 7:01 PMrp_st
03/28/2024, 7:01 PMavi.f
03/28/2024, 7:01 PMavi.f
03/28/2024, 7:03 PMrp_st
03/28/2024, 7:03 PMavi.f
03/28/2024, 7:05 PMrp_st
03/28/2024, 7:05 PMavi.f
03/28/2024, 7:08 PMrp_st
03/28/2024, 7:09 PMavi.f
03/28/2024, 7:12 PM