Repository navigation
docs: add auth and context - #112
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #112 +/- ##
=======================================
Coverage ? 76.23%
=======================================
Files ? 9
Lines ? 711
Branches ? 145
=======================================
Hits ? 542
Misses ? 167
Partials ? 2 ☔ View full report in Codecov by Sentry. |
|
Thanks @sandros94, this gave me some much needed guidance! However, I found that setting the context to an object doesn't work, you have to set specific properties. For example (using Trying to set upgrade(request) {
request.context = { data: 'test'}
},
open(peer) {
console.log(peer.context) // logs {}
}Setting a specific property in upgrade(request) {
request.context.data = 'test'
},
open(peer) {
console.log(peer.context) // logs { data: 'test' }
} |
Co-authored-by: Travis Reynolds <travis@travisreynolds.dev>
|
@travis-r6s thanks for reporting it! Indeed context is already initialized 😅 |
|
Good point @travis-r6s ~> #115 |
# Conflicts: # docs/1.guide/2.hooks.md
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe "Hooks" guide is updated to rename the ChangesHooks Guide Documentation Update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolves #88
Should I also add an auth example via cookie?
I might need some help on the
ok: falsebackward compatible thingSummary by CodeRabbit
close(peer, details)hook example (replacing the prior naming)contextfromupgrade, available aspeer.contextin later hooksupgrade, including blocking unauthorized upgrades with a 401 response andWWW-Authenticate(Basic auth example)