Hey guys I'm using next js, getting infinite call ...
# general
j
Hey guys I'm using next js, getting infinite call
/refresh
on Safari (Works fine from Chrome) ``` SuperTokens.init({ appInfo: { appName: 'Test', apiDomain: 'http://localhost:3000', websiteDomain: 'http://localhost:8080', apiBasePath: '/api/v1/public/auth', websiteBasePath: '/auth' }, recipeList: [ Passwordless.init({ contactMethod: 'EMAIL' }), Session.init({ cookieDomain: 'http://localhost:8080' }) ] })
r
hey @John Michal
so the request after the refresh API calls returns a 401 as well?
j
return 200
r
are you calling the refresh API yourself?
i mean what is trigerring the initial refresh call?
j
i use supertoken sdk and axios ``` Session.addAxiosInterceptors(instance )
"supertokens-auth-react": "^0.19.0"
r
no i mean when does the refresh get called? After some APi call? Or navigation to some page?
Can I see the cookie store as well?
j
navigate to page res.redirect(
http:localhost:8080/success
)
r
hmm values seem to be correct.
what version of react are you using?
j
``` "react": "^16.8.6", "supertokens-auth-react": "^0.19.0", "next": "9.5.0"
r
what is the code look like on the success page?
are you using our auth wrapper? How? Are you using session context? How?
j
yeah i use, NoSSR wrapper
r
is the user getting redirected to the /feedback page?
as in is your useEffect running?
j
no keep calling /refresh on safari redirect working on chrome
r
do you wrap the success component with our auth wrapper?
j
yeah
r
the PasswordlessAuth component
can I see how you do that?
j
``` import Dynamic from 'next/dynamic' import Passwordless from 'supertokens-auth-react/recipe/passwordless' const PasswordlessAuthNoSSR = Dynamic(new Promise(res => res(Passwordless)) as any, { ssr: false }) return {children}
r
And children is equal to Success component?
j
yes correct
r
hmm.
Can we get on a call to debug? Seems really strange
@John Michal
@John Michal can you upgrade the auth-react SDK version to the latest one and try again?
6 Views