-
Notifications
You must be signed in to change notification settings - Fork 21
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
Describe how authentication should be handled #88
Comments
I also would appreciate some more detail on the flow mentioned here. What exactly is the difference in intention between returning a response or just the headers of a response? Personally I think a more explicit For context I am currently exploring integrating native WebSocket support into SvelteKit, and this package seems to be a pretty fantastic fit. |
Even if |
Some improvements in 0.3.2 should help this. Let's make an example in docs for simple session/auth handling. (PR is more than welcome if anyone is interested in helping!) |
I'm happy to help. Do I understand it correctly? (I'm having doubts on the first step)
P.S.: I'm rereading the latest changes, as I might have missed some logic EDIT:
does it mean between hooks or something else? |
I think for crossws we can use a simple example using standard request and headers to check something like basic auth or a cookie. When auth fails, we throw a Response. If not fails, we can (optionally) return some headers, mainly usable for setting a cookie but perhaps we can just use a comment to say it is possible. Shared context can be modified from request.context in upgrade and access/update from peer.context. Context could be volatile in clousflare durable only. It can be useful for things like caching a computation (h3 session for example is cached in context) I think we could have two examples for auth and context, if you have some ideas feel free to open a draft i can help from there! |
Describe the change
I'm not super familiar with web sockets and am not sure if
crossws
might have any of its own requirements.If you want a secure connection do you use
wss://
and then return the response fromhandleUpgrade
if the user is authenticated and there's an upgrade header and a 403 response if not authenticated even when there's an upgrade header?URLs
No response
Additional information
The text was updated successfully, but these errors were encountered: