If you’re an Elixir developer and you’ve created a new Phoenix LiveView application in the last few years then you’ve likely come across the excellent authentication generator that ships out of the box with Phoenix.
For the uninitiated, a brand new Phoenix app can tack on a Postgres-backed, bcrypt-hashsed, session-storing, pre-built authentication system in about 30 seconds right out of the box.
All you have to do is run
mix phx.gen.auth
and you’ll be asked if you want a LiveView or a DeadView version.The best part is you get to fully customise the implementation since the generator locally installs everything into your source code, you’re not using someone else’s library or third-party system to manage auth, you’re doing it right in your app. Even if you want to opt for something like Auth0, this is easily the fastest way to add authentication to your new app - for what it’s worth I haven’t seen a faster way to add authentication in any stack.
The truth is, today’s web users have come to expect lightning-fast sign-up journeys, and anything less can raise serious concerns about a website’s legitimacy. Without the familiar comfort of Google’s seamless login experience, you’re essentially inviting users to abandon ship. Let’s face it - friction is a major obstacle that can kill user engagement.
On one of my latest projects, Uini, adding Google Authentication massively improved conversion from visiting users to registered users. Check out Uini if you want to make gathering feedback from your users effortless.
All of this sounds useful and maybe scary, but don't let the intricacies of Google's site deter you! With the right approach, handling OAuth tokens, credentials, and client secrets becomes a seamless process. And I'm here to guide you through it. By harnessing the power of
mix phx.gen.auth
, you'll discover that integrating authentication with your Phoenix app is remarkably straightforward.So, let's dive in and tackle this challenge head-on!
continue reading on chrisgregori.substack.com
⚠️ This post links to an external website. ⚠️
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.