clerk / clerk-sdk-ruby

Access the Clerk Backend API from Ruby
MIT License
24 stars 10 forks source link

endpoint is deprecated and pending removal #43

Closed tonydaly closed 5 months ago

tonydaly commented 8 months ago

Heya,

I'm following this guide: https://clerk.com/docs/references/ruby/rack-rails

I'm setting the Authorization header in my frontend (@clerk/remix) and it's all passed through correctly. In my controller I can call clerk_user and clerk_user_signed_in?. But following the guide when I call clerk_session I get the error that the endpoint is deprecated:

Clerk::Errors::Fatal: {"errors"=>[{"message"=>"endpoint is deprecated and pending removal", "long_message"=>"This endpoint is deprecated and will be removed in future versions. We strongly recommend switching to networkless verification using short-lived session tokens, which is implemented transparently in all recent SDK versions (e.g. NodeJS SDK https://clerk.com/docs/backend-requests/handling/nodejs#clerk-express-require-auth). For more details on how networkless verification works, refer to our Session Tokens documentation https://clerk.com/docs/backend-requests/resources/session-tokens.", "code"=>"operation_deprecated"}], "clerk_trace_id"=>"b8da8d078aaae67646be5cc80fc40492", "status"=>410}

Any help appreciated!

georgepsarakis commented 8 months ago

Hello @tonydaly , sorry that you've encountered this issue with the SDK! There's a chance that our documentation needs some updates, so thanks for reporting. Can you confirm that you're using Version 2 of the Rack Middleware?

You should be able to use the clerk_verified_session_claims method, which doesn't require a Backend API request, instead of clerk_session:

https://github.com/clerk/clerk-sdk-ruby/blob/f1881445ad0af03fbd76a3246bcb0c0e19b4a338/lib/clerk/authenticatable.rb#L13-L15

Let me know if that helps!

dimkl commented 6 months ago

@tonydaly Did the above suggestion resolve your issue?

dimkl commented 5 months ago

Closing this issue as it's been stale for a long time. Feel free to re-open!

papercrane-elijah commented 1 month ago

Hello folks. Im' curious why this is not in the documentation somewhere?

https://clerk.com/docs/references/ruby/rack-rails