The Pragmatic Studio

LiveView Course Update #5: Live Auth, Sessions, and Presence

March 22, 2023

Robust authentication! Multi-user, real-time presence updates! You’d settle for nothing less in today’s web apps, right? 😉

So you’ll love this week’s round of 5 new videos in our Phoenix LiveView course…

Authenticating LiveViews

How does authentication work when it comes to LiveView and websocket connections? For starters, you need a secure session-based authentication system that has all the standard features: register, log in, log out, and so on. And thankfully Phoenix has a built-in generator to add a full-featured authentication system right into your app. We walk through the relevant code and then use it to seamlessly and securely authenticate LiveViews.

Live Sessions

You often want to enforce the same authentication policy across a group of live routes. That’s where live sessions come in super handy. And LiveView has special optimizations for live navigating between LiveViews in the same live session. You won’t want to miss these pro-level design and performance techniques!

Presence Tracking

Presence tracking is typically a DIY project. Not so with Phoenix! It has unrivaled, built-in presence tracking that uses PubSub to broadcast presence updates in real-time. We combine it with LiveView to build a fun yet real-world application.

New Minor Phoenix Release

Phoenix 1.7.2 was released earlier this week. This minor release doesn’t affect any code we’ve written in the videos or any of the exercises so far.

However, you will need to download the latest code bundle for what’s coming next. See the update steps for steps on updating your app.

How do I get the new course modules?

If you purchased the previous Pro version of the course, go to your account dashboard and click the big green “REDEEM” button to get the new Pro course for free. Or, if you’ve already done that, just head over to the course and you’ll find the new modules ready for you!

Don’t yet own the Pro course? What are you waiting for? You can do amazing things with LiveView! And there’s still time to get the Pro course at the early access price, but time is running out!

Next up we dive into JavaScript commands and hooks! 🪝