Logging out on refresh
Hi, I have react application with Kinde auth. On localhost everything works perfectly, you can log in and the session is persisted after refresh. But I have a problem with the project that is deployed on azurewebsites.net, so my url is something like this: https://myapp.azurewebsites.net. In here users can log in but are logged out after refresh, what might be the problem?
The configuration on kinde dashboard looks good.
this is my provider:
<KindeProvider
clientId='xxx'
domain='https://xxx.kinde.com'
redirectUri={window.location.origin}
logoutUri={window.location.origin}
>
<App />
</KindeProvider>
Thank you in advance
6 Replies
Hi Temo, Thanks for reaching out.
I just need a few details to better understand and help fix the issue:
1. What authentication method are users using to sign in?
2. What SDK and version are you currently using?
3. Have you tried deploying the project on another test platform like Vercel to see if the issue still happens?
Thanks
Thanks
Thank you for the response
1. we are using email + password, Apple, Facebook, Google.
2. I am using v4.0.4
3. Have not tried this yet
I also tried to update to version 5 but I get this kind of errros:
Can't import the named export 'KindeProvider' (imported as 'KindeProvider') from default-exporting module (only default export is available)
I am using react v18, which might be the problem (not sure yet)
Thanks for the response. While we check the issue, could you also try it on a test platform like Vercel to ensure the issue isn’t coming from azurewebsites.net?
the only thing that helped was this:
isDangerouslyUseLocalStorage={true}
is there another, better way to fix this?
Hey, Temo..
The solution is to use Kinde's Custom Domain. And I just noticed that the KindeProvider you shared at first, it uses a 'xxx.kinde.com' domain. For this to fully works, you need to use your custom domain instead.
Can you check this one and let me know, also remember to update your application's environment variables and configuration to use the new custom domain URL after it's set up.
For more information about setting up custom domains in Kinde, you can visit :
https://docs.kinde.com/build/domains/pointing-your-domain/
The solution is to use Kinde's Custom Domain. And I just noticed that the KindeProvider you shared at first, it uses a 'xxx.kinde.com' domain. For this to fully works, you need to use your custom domain instead.
Can you check this one and let me know, also remember to update your application's environment variables and configuration to use the new custom domain URL after it's set up.
For more information about setting up custom domains in Kinde, you can visit :
https://docs.kinde.com/build/domains/pointing-your-domain/
ok thanks, will try