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.