11. Using Guardian to refresh a JWT session for Elixir REST API Tutorial

Опубликовано: 22 Апрель 2026
на канале: Elixir Mentor
1,735
54

In a step-by-step tutorial, we use Guardian.DB to refresh a JSON Web Token of an authorized account in our REST API Tutorial. Guardian.DB works by hooking into the lifecycle of our Guardian module. We create a refresh session endpoint that takes a valid JWT, refreshes it, and returns the new token with the account struct. Follow along for a step-by-step tutorial to learn how to implement on_refresh with Guardian.DB, allowing us to refresh and revoke old tokens in our Elixir REST API Tutorial.

Subscribe now, and we'll walk through a hands-on introduction to Phoenix and Elixir. If you want to learn how to code in Elixir, this Elixir tutorial is the perfect introduction! I will teach you the basics of setting up a RESTful API and programming concepts, so you can start building powerful applications in this beautiful language. Start learning with this Elixir programming tutorial today and see how easy it is to get started and learn Elixir!


✅✅SOLUTION: https://github.com/BackendStuff/real_...

SUPPORT BACKEND STUFF
---------------------------------------------------
🎙🎙Check out my podcast: https://www.hiredgunapps.com/podcast


🆘🆘NEED HELP?? Join the Discord Server:   / discord  




FOLLOW ME
---------------------------------------------------
Instagram:   / jacob_luetzow  
Join the Discord server:   / discord