Hello guys! I'm trying to integrate my backend(ne...
# support-questions-legacy
b
Hello guys! I'm trying to integrate my backend(nestjs) with vanilla js frontend. Everything seems to be working, except refreshing the session.
I've added this to load up the interceptors and session processing on the frontend
r
Can you enable frontend debug logs and show the output when you make an api call?
b
I'm afraid I do not know where to enable them
r
Search for debug logs in our docs.
b
r
I’d like to see the frontend logs
b
I might be doing somehing wrong, I updated the frontend code and the logs don't show up in the browser console
r
Hmmm. None at all?
b
Empty
r
That’s odd
Can you add a print statement right before supertokens.init is called? Do you see that?
b
Yep, I found additional dot right after script declaration Still can't see any logs or alerts thought, although syntax highlighting started working
r
Even if you add a console log right before calling the init function- it doesn’t get printed?
b
yep
r
Strange. Not sure
b
I think the problem is with the multiline script Sorry to waste your time, I thought I was missing something related to the setup
r
No worries.
Also, you might want to use. Specific version of our scripts
So that you don’t automatically get a breaking change which will break ur site
b
It's a uni project, it's okay
upd: now logs are sent on the login page if my access token has expired, I still get the same try refresh token message
and no logs
r
Right. What are the logs you do see?
It’s probably cause the network interceptor we have is not being applied to your api calls
Make sure to run supertokens.init on all pages you have
b
I've put the include file as high as I can in the .pug file, still giving 401 when the access token has expired. In any other case I see logs just fine
r
Do you see any logs from our SDK in the non login page?
b
No
r
So that’s the issue
You need to make sure supertokens init is in app pages
b
What do you mean by app page? I don't use any of the frameworks
r
So call supertokens init on all your pages. Not just the login page
b
Yep, i do it everywhere
r
Right. Then you should see the debug logs on all pages
If you don’t see that, it means you aren’t calling supertokens.init
b
Yep, except when the token has expired, and I don't see any of the logs
Other than that it works
r
So you see the debug logs on all pages?
b
Here's the index page when I'm logged in
And here it is when the access token has expired
r
Oh. So you are doing server side rendering
Right. You may want to check out docs for server side rendering
Should solve your issue
b
Thanks!
5 Views