-
Couldn't load subscription status.
- Fork 189
feat(web): use session from setSession() for realtime #1216
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
Conversation
At the moment, if a cookie isn't set, only the local storage cookie fallback is used for realtime authentication. This means sessions using client.setSession() will be unauthenticated when using realtime. This PR makes realtime use this.config.session (which is set with client.setSession()) if it exists.
WalkthroughIn the client template, session resolution in the "connected" onMessage path now prefers this.config.session and falls back to reading Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks @hmacr for testing this:
|


What does this PR do?
At the moment, if a cookie isn't set, only the local storage cookie fallback is used for realtime authentication. This means sessions using client.setSession() will be unauthenticated when using realtime.
This PR makes realtime use this.config.session (which is set with client.setSession()) if it exists.
Test Plan
This needs to be tested still.
Related PRs and Issues
Have you read the Contributing Guidelines on issues?
None
Summary by CodeRabbit
Bug Fixes
New Features