Replies: 1 comment
-
The token refresher only works when the server responds with the In the snippet above, adding |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've got a SPA that connects to anycable on my rails 7.2 app. I'm upgrading from anycable 1.2 -> 1.5, and want to enable the JWT token auth for subscriptions. It looks like the refresh flow is worked out and very smooth, but is there a way to initialize the Cable without the token, and apply it after the token request succeeds? I was hoping something like this would work, but it doesn't seem to retry the failed subscriptions after the url changes
The only other option I see requires jumping through some silly hoops of only creating the consumer after I have the token, which means changing all the components and services in my app to either handle the concept that the consumer isn't ready yet, or make some sort of subscription queue that only gets processed after the consumer is initialized…
I think I'm missing something though—what's the preferred way to do this? Is there a hook I missed in the anycable docs?
Beta Was this translation helpful? Give feedback.
All reactions