Sorry for the late reply, but I am really working on the same issue and want to share my opinion on this.
Firstly, I would like to emphasize that Iโm not changing the sources of Davise, this is likely to lead to further problems, especially when changing the Devise code.
On the other hand, since I came across devess-token-auth, this may not be suitable for your needs, especially in distributed systems (SOA). I may be mistaken, but since I see dev-token-auth, you cannot add Subjects to restrict user access exclusively to the token. If you do not need this function, you really need to try dev-token-auth.
If you want to store additional information in a token, you can try to authenticate according to the usual design or dev-token-auth, and then encode your information using the JWT pearl.
An example can be found here: https://www.sitepoint.com/introduction-to-using-jwt-in-rails/
source share