gushonorato

gushonorato

Magic Auth - An Phoenix Authentication Library Designed for Effortless Setup 🚀

Hey everyone! :waving_hand:

I’m excited to share a new library with you all: Magic Auth! It’s an authentication library for Phoenix projects that aims to make your life as a developer easier by offering an authentication solution with minimal setup effort.

Why I Built Magic Auth

While phx.gen.auth is amazing, it can require a significant amount of time to implement all the necessary flows, such as password resets, recovery screens, and UI customization. Magic Auth is designed to simplify authentication, requiring virtually the same minimal effort as implementing a BASIC HTTP authentication flow, but with much more power!

What Magic Auth Brings to the Table

Here’s a quick rundown of the key features:

• Ship Faster :rocket:: No time wasted configuring password resets and recovery flows—just implement and ship your product.

• Passwordless Authentication :incoming_envelope:: Secure login process through one-time passwords sent via email. One-time passwords are better than magic links because users can receive the code on one device (e.g., phone email) and enter it on another (e.g., desktop browser).

• Enhanced Security :locked:: Protect your application from brute force attacks with built-in rate limiting and account lockout mechanisms.

• Customizable Interface :artist_palette:: Use the beautiful default UI components out of the box, or customize them fully to match your design perfectly.

• Effortless Configuration and Comprehensive Documentation :books:: Quick and simple integration with your Phoenix project, with detailed guides and references to assist you through every step of the integration process.

• Schema Agnostic :bust_in_silhouette:: Implement authentication without requiring a user schema—ideal for everything from MVPs to complex applications.

Why This Matters

I’m deeply passionate about making the Elixir/Phoenix ecosystem the go-to choice for building MVPs and startups. I truly believe Elixir and Phoenix have unmatched potential for speed, scalability, and developer happiness.

Authentication can often be a roadblock, especially when you’re moving fast to validate ideas or launch a product. Magic Auth removes that friction so you can spend less time on boilerplate and more time building something awesome.

Check out Magic Auth on GitHub: GitHub - gushonorato/magic_auth: An Elixir authentication library designed for effortless setup.. Give it a try, and let me know your thoughts! Your feedback can help shape Magic Auth into an even better tool for the community.

Let’s make the Elixir/Phoenix ecosystem the best place to build startups and MVPs.

Cheers,
Gustavo

P.S. Feel free to ask questions or share your thoughts. I’d love to hear how Magic Auth can help your projects! :blush:

Most Liked

gushonorato

gushonorato

Thank you for your feedback! I believe that with just a few modifications, I can add support for sending TOTP to a phone instead of email. Could you please open an issue on GitHub describing your use case?

gushonorato

gushonorato

Release 0.2.0

Hey everyone! I’m excited to announce the release of Magic Auth v0.2.0, packed with several improvements and new features.

:sparkles: Enhancements

  • Multi-tenancy support via query prefixes and foreign keys.
  • Improved error messaging when mix magic_auth.install fails to inject code into the necessary files.
  • You can now return a tuple like {:allow, user_id} from the log_in_requested/1 callback. Magic Auth will store the user ID in %Session{user_id: user_id}, and fetch_magic_auth_session/2 will automatically load and assign the user to :current_user.
  • Default logging for success and error messages in the generated email-sending code.
  • New test helpers to streamline testing. Check out the Testing Guide for details.

:warning: This version includes breaking changes. Make sure to review the Changelog for migration instructions.

nix2intel

nix2intel

Will this support totp in the future where i can setup a phone or passkey for auth? Looks amazing btw.

gushonorato

gushonorato

[Release] Version 0.1.1 – Important Security Fix

Hello everyone,

We’ve just released version 0.1.1, and we strongly recommend updating to this latest version as it includes a critical security fix.

[0.1.1] - 2025-01-29

Fixed

  • One-time passwords are not being deleted after verified, allowing them to be reused multiple times until they expire.

Please update as soon as possible and let us know if you have any feedback! :rocket:

Thanks for your support!

sreyansjain

sreyansjain

Great work. Congratulations and Thank you.
Do you have any guide about using Magic Auth without liveview?
I wan’t to use Magic Auth with phoenix controllers and (dead) views. Please advise.

Where Next?

Popular in Libraries Top

oltarasenko
Dear Elixir community, After a year of development, bug fixes, and improvements, we are proudly ready to share the release of Crawly 0.1...
New
markmark206
simple_feature_flags is a tiny package that lets you turn features on or off based on which environment (e.g. localhost, staging, product...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
vic
Expat is a tiny experiment I did for extracting patterns and being able to reuse them (compose and share patterns between elixir librarie...
New
Azolo
Hey everyone, I just released WebSockex which is a Elixir WebSocket client. WebSockex strives to work as a OTP special process, be RFC6...
New
Hal9000
Here is my first stab at this. README pasted below. https://github.com/Hal9000/elixir_random Comments and critiques are welcome. Th...
New
ostinelli
Let’s write a database! Well not really, but I think it’s a little sad that there doesn’t seem to be a simple in-memory distributed KV da...
New
mplatts
With HEEX released we decided to start a components library using Tailwind CSS - check it out here: Petal Components. We also have a boi...
New

Other popular topics Top

openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

Sub Categories:

We're in Beta

About us Mission Statement