https://supertokens.com/ logo
#general
Title
# general
j

John Michal

05/09/2022, 4:26 PM
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

rp

05/09/2022, 4:28 PM
hey @John Michal
so the request after the refresh API calls returns a 401 as well?
j

John Michal

05/09/2022, 4:30 PM
return 200
r

rp

05/09/2022, 4:30 PM
are you calling the refresh API yourself?
i mean what is trigerring the initial refresh call?
j

John Michal

05/09/2022, 4:32 PM
i use supertoken sdk and axios ``` Session.addAxiosInterceptors(instance )
"supertokens-auth-react": "^0.19.0"
r

rp

05/09/2022, 4:32 PM
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

John Michal

05/09/2022, 4:35 PM
navigate to page res.redirect(
http:localhost:8080/success
)
r

rp

05/09/2022, 4:36 PM
hmm values seem to be correct.
what version of react are you using?
j

John Michal

05/09/2022, 4:37 PM
``` "react": "^16.8.6", "supertokens-auth-react": "^0.19.0", "next": "9.5.0"
r

rp

05/09/2022, 4:38 PM
what is the code look like on the success page?
are you using our auth wrapper? How? Are you using session context? How?
j

John Michal

05/09/2022, 4:46 PM
yeah i use, NoSSR wrapper
r

rp

05/09/2022, 4:47 PM
is the user getting redirected to the /feedback page?
as in is your useEffect running?
j

John Michal

05/09/2022, 4:49 PM
no keep calling /refresh on safari redirect working on chrome
r

rp

05/09/2022, 4:50 PM
do you wrap the success component with our auth wrapper?
j

John Michal

05/09/2022, 4:50 PM
yeah
r

rp

05/09/2022, 4:50 PM
the PasswordlessAuth component
can I see how you do that?
j

John Michal

05/09/2022, 4:55 PM
``` 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

rp

05/09/2022, 4:59 PM
And children is equal to Success component?
j

John Michal

05/09/2022, 4:59 PM
yes correct
r

rp

05/09/2022, 4:59 PM
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