Passport Magic Login

screenshot of Passport Magic Login
express

Passwordless authentication with magic links for Passport.js.

Overview:

Passport-magic-login is a passwordless authentication solution for Passport.js that allows users to sign up and log in without the need for passwords. It offers support for magic links sent via email, SMS, or any other preferred method. This user-interface-agnostic tool handles secure token generation, expiration, and confirmation. Originally implemented by Tobias Lins for Splitbee, it was later extracted for Feedback Fish.

Features:

  • Passwordless Authentication: Users can sign up and log in without passwords.
  • Various Verification Methods: Supports magic links sent via email, SMS, or any preferred method.
  • User Interface Agnostic: Only requires an input and a confirmation screen.
  • Secure Token Management: Handles token generation, expiration, and confirmation.

Frontend Usage:

npm install passport-magic-login

Backend Setup:

  1. Setup the Passport strategy and Express routes on your server.
const passport = require('passport');
const MagicLoginStrategy = require('passport-magic-login').Strategy;
passport.use(new MagicLoginStrategy());
  1. Add routes to your Express server.
app.post('/auth/login', passport.authenticate('magiclogin'), (req, res) => {
  res.send('Successfully authenticated using magic link');
});

Summary:

Passport-magic-login offers a secure and convenient way for users to authenticate without passwords. By utilizing magic links for authentication, this tool simplifies the user experience while ensuring secure token management. With easy installation and setup, it provides a seamless solution for implementing passwordless authentication in web applications.

express
Express

Express.js is a simple Node.js framework for single, multi-page, and hybrid web applications.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.