-
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
Ability to skip cookie validation in middleware #129
Comments
Hello @odannyc |
With GraphQL I only have 1 endpoint ( |
We're encountering the same issue.
|
I'm not sure if this helps, but the new v2 version of the library provides a middleware that only checks for bearer token authentication, with the Authorization header. |
Are there plans to support cookies again? |
Hi, @matthewshirley, yes, we do have plans for supporting cookie-based authentication again in v2. We decided to release v2 without it because usage wasn't that high. It's definitely on our roadmap though. If you don't mind me asking, what's your setup like? |
@gkats That's great, thank you! The setup is an SSR Go app using HTMX. |
Hi @gkats, I have the same scenario with SRR go app, would you mind sharing what's the progress on cookie-based auth for v2? Should I just use v1? |
Hi @zakpaw, unfortunately priorities have shifted and cookie based support for v2 of our Go SDK is not at the top of the list. I don't think I can provide an ETA, so in the meantime my suggestion would be to use v1. Really sorry I don't have better news to share. |
Related to clerk#129 Add an option to skip cookie verification in the middleware. * Add a new `Options` struct to hold middleware options and a `WithSkipCookieVerification` function to set the `SkipCookieVerification` option in `clerk/middleware_v2.go`. * Modify the `WithSessionV2` function in `clerk/middleware_v2.go` to check for the `WithSkipCookieVerification` option and skip cookie verification if set. * Add tests in `clerk/middleware_v2_test.go` to verify the functionality of the `WithSkipCookieVerification` option, covering both scenarios: with and without the option. * Update the example in `examples/middleware/main.go` to demonstrate the usage of the `WithSkipCookieVerification` option. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/clerk/clerk-sdk-go/issues/129?shareId=XXXX-XXXX-XXXX-XXXX).
We currently use graphql for all of our requests from frontend (nextjs and react native) to our backend (Go).
We explicitly add the
Authorization
header to all those requests, so no need to do the cookie verification in the middleware. This is also causing issues for us because when we use graphiql everything comes back as 401 and we're unable to send debug requests through that tool.Ideally we could simply add an "Option" (
WithSkipCookieVerification
): https://github.com/clerkinc/clerk-sdk-go/blob/98a655dfd24721353e05027bece746304748399b/clerk/middleware_v2.go#L46Thanks
The text was updated successfully, but these errors were encountered: