Infinite redirect loop in Chrome on Mac OS X
phpb-com opened this issue · 3 comments
When using with Cloudflare Access in Chrome, I've experienced infinite redirect loop when trying to refresh page after the first visit. Removing addOneDay and just comparing based on the current date (token not yet expired) fixes the problem. Is there a reason why we need to ensure that expiration is one day in the future? I thought that will depend on the application configuration and should not always be the case.
Line 62 in 49cb2cc
Hey! Thanks for your interest in the project, and very cool to see that you're also using it with Access!
The reason we make this check is to prevent a situation where a user joins a room, then a few minutes into their call, their token expires, meaning they can no longer open/close tracks for users who may join/leave as the meeting progresses.
To ensure this doesn't happen, we check the freshness of the token, and if it's less than 24 hours we force them to get a new one.
As for the reason you're encountering infinite redirect loop — make sure that you have Same Site Attribute
set to Lax
in your Access configuration. That should resolve the issue, assuming your tokens have a lifespan > 24 hours.
Perhaps we could make that 24 hour window configurable via environment variable — it's always tricky trying to guess "how long is enough" for a video call to last.
That makes sense. Should I try and submit a PR to make it configurable, or will you be working in that area. Thanks.