Hi again. I have implemented an auth flow with exp...
# support-questions
Hi again. I have implemented an auth flow with expressjs server + react native on localhost, ngrok and Hasura before. It was working great. Today I have switched to a vercel app following the example here https://github.com/supertokens/supertokens-auth-react/blob/master/examples/with-emailpassword-vercel/api/index.js. Again everything works fine except SuperTokens.getAccessTokenPayloadSecurely()).jwt. When I try to get the JWT it returns
Could not refresh session
You can see the session init here. JWT is enabled and issuer is set to vercel auth path. I would really appreciate any ideas.
Can you enable debug logs on the backend and then query that? And show me the Log output
See the troubleshooting section on how to enable debug logs
I can pass DEBUG=com.supertokens arg when running vercel on localhost like
DEBUG=com.supertokens vercel dev
but not sure how to achieve that with vercel deploys. I have tried adding
"vercel-build": "DEBUG=com.supertokens node ./api/index.js"
to package json but even though I can see the logs the build never gets completed.
With localhost
vercel dev
everything works perfect though. I can get the JWT with
(await SuperTokens.getAccessTokenPayloadSecurely()).jwt
without any issues.
What is the appInfo that you have configured on the backend and frontend? During production deployment
My frontend app info:
Copy code
    apiDomain: https://akasa-audiobook-auth-server-offminded.vercel.app,
    apiBasePath: '/api/auth'
Backend app info:
Copy code
appInfo: {
      appName: my-project-audiobook,
      apiDomain: https://akasa-audiobook-auth-server-offminded.vercel.app,
      websiteDomain: https://akasa-audiobook-auth-server-offminded.vercel.app,
      apiBasePath: '/api/auth',
      websiteBasePath: '/auth',
When you query doesSessionExist on the frontend, does it work correctly?
Does doing an API call that requires session verification work correctly?
Yeah, seems to be working. DoesSessionExist returns true and right after that I try to get jwt and it fails.
Hmm. That’s really strange.
Can you delete the sAccessToken cookie and then make an API call that requires a session?
Does it refresh the session automatically?
Let me try that
Ok I have tried and my vercel backend does not seem to be able to refresh session properly.
I have given up trying with vercel and moved my backend to Heroku. All working fine with it.
It might be something to do with vercel node runtime config. Memory or max duration might be the factor here not sure.
Hmm. We have tried to deploy app with vercel and it works all fine. But if you got it to work in heroku, then I guess that’s good enough!