Using anycable-client to auto-refresh tokens

preview_player
Показать описание
This episode continues exploring our token-based authentication and the token expiration problem in particular. To solve it, we switch to AnyCable JS client, which provides a token refreshing mechanism out-of-the-box.
The migration process involves some JavaScript debugging and re-implementing @hotwired/turbo-rails functionality.

00:00 Intro
00:52 reason: "token_expired"
03:44 @anycable/web
14:59 fetchTokenFromHTML()
17:18 X-ANYCABLE-OPERATION: "token-refresh"
18:27 @anycable/turbo-stream
19:56 Outro
Рекомендации по теме
Комментарии
Автор

Great series! Is there any github repo for this app? Also.. i really like the way you setup your VS Code.. is that a special theme your using? :) Keep up the good work! I haven't used Rails for any projects in some time but Rails 7 has gotten me wanting to use Rails again.

teddybear_lost
Автор

Why we don't have it by default in Rails? Doesn't it make much more sense?

siyaram