ActionCable and Devise - how to get the current_user

Hello,

I’ve followed DHH’s ActionCable chat demo (
Rails 5: Action Cable Demo. Action Cable is the highlight feature… | by DHH | Medium),
and it works perfectly with this simple setup.

So logically the next step is adding user registration to the app and
writing the user name in front of the message that has been posted.

Once I add a User model and Devise to my application, I get a bit lost.
What I’d like to accomplish is having a user log through the Devise
users/sign_in page, and identifying the “current_user” inside the
MessageBroadcastJob.

I’ve already tried an uglier way (transmitting user.id through a cookie)
but the valued is encrypted.

What would be the best way to get this information ?

Thanks for your help !
Cyril