Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite redirect loop in Chrome on Mac OS X #86

Open
phpb-com opened this issue Aug 17, 2024 · 3 comments
Open

Infinite redirect loop in Chrome on Mac OS X #86

phpb-com opened this issue Aug 17, 2024 · 3 comments

Comments

@phpb-com
Copy link

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.

if (addOneDay(now) > expires) {

@phpb-com phpb-com changed the title Infinite redirect lop in Chrome on Mac OS X Infinite redirect loop in Chrome on Mac OS X Aug 17, 2024
@third774
Copy link
Collaborator

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.

@third774
Copy link
Collaborator

third774 commented Aug 19, 2024

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.

@phpb-com
Copy link
Author

That makes sense. Should I try and submit a PR to make it configurable, or will you be working in that area. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants