Skip to content

Conversation

@sandros94
Copy link
Member

Resolves #88

Should I also add an auth example via cookie?

I might need some help on the ok: false backward compatible thing

@codecov
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@9a8d499). Learn more about missing BASE report.

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.
📢 Have feedback on the report? Share it here.

@travis-r6s
Copy link

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 crossws@0.3.3):

Trying to set request.context to a new object:

upgrade(request) {
  request.context = { data: 'test'}
},
open(peer) {
  console.log(peer.context) // logs {}
}

Setting a specific property in request.context:

upgrade(request) {
  request.context.data = 'test'
},
open(peer) {
  console.log(peer.context) // logs { data: 'test' }
}

Co-authored-by: Travis Reynolds <travis@travisreynolds.dev>
@sandros94
Copy link
Member Author

@travis-r6s thanks for reporting it!

Indeed context is already initialized 😅

@pi0 pi0 mentioned this pull request Jan 29, 2025
@pi0
Copy link
Member

pi0 commented Jan 29, 2025

Good point @travis-r6s ~> #115

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

Successfully merging this pull request may close these issues.

Describe how authentication should be handled

4 participants