5 Creative Uses of Magic Links
Tags: webdev, programming, security
Published: 2023-01-23 22:48:53

Magic links, also known as passwordless logins or one-time links, have become an increasingly popular way to improve the user experience and increase security for various online applications and services. 

Magic links typically work like this:

![How magic links work](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/82n68yhsm7pgdpw4c2cs.png)

This comes with some nice benefits, for example, you don’t need a separate sign up and login page and your users don’t need to remember a password to log in. However, past the obvious use case of logging users in, magic links can also be used in other areas of your product to provide a more seamless experience.

Here are five effective ways to use magic links in your products:

## Auto-login when sharing content

Imagine you are building a B2B SaaS product where your users can create and share analytics dashboards. One of your users creates a dashboard and then wants to share it with their coworker. 

They click **Share**, enter the coworker’s email, and a link is sent. There’s two things that can happen:

- The coworker is already logged in, so they can immediately see the dashboard
- The coworker isn’t logged in, so they have to log in first before they can see anything

With magic links, we can do better! Instead of sending them a link to the dashboard, we can send them a magic link that logs them in and then redirects them to the dashboard. 

![Coworker sharing workflow](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gcqdfr6bv1hpv6x6ez7r.png)

Within [PropelAuth](https://www.propelauth.com/), we provide APIs that you can use to generate your own magic links that redirect to custom locations after the user logs in. This is actually one of the most common use cases for that API.

## Seamlessly move a user from desktop to mobile

Mobile authentication can be painful. Asking a user to type a complex password on a mobile device is a great way to make them annoyed before they even start using your product. 

Social logins / SSO are one great option to reduce friction here, but magic links are another great option. 

Let’s look at a product like [PagerDuty](https://www.pagerduty.com/), which is used to send alerts when issues arise. Most customers that are configuring PagerDuty are going to use their desktop to set up their on-call schedule, generate API keys, etc.

However, an important step in the process is setting up your phone, for use cases like adding PagerDuty’s phone numbers to the exceptions to your DND settings.

![QR Code Auth](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tfjcabss3ksgau8v8ziq.png)

One simple way of moving your users over from the desktop to their mobile device is via a magic link. You can make this even easier by formatting that magic link as a QR code.

## Easy waitlist onboarding

![Waitlist example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/da097d3bygmj8w464and.png)

[Waitlists](https://www.propelauth.com/post/onboarding-users-from-a-waitlist) are a great way to figure out if there’s a market for your product before your product is ready. One of the classic problems with waitlists, though, is there can be pretty high churn when you try to convert those waitlist users to real users.

To combat this, you should make the onboarding process as smooth as possible. Instead of sending a link asking them to create an account, why not just sent them a link that gives them instant access to the product?

## Set up a low-code login pipeline with Stripe

Every funnel has drop off. The more things you ask your users to do, the more you will lose some percent of people along the way.

If you are building a product where your main source of revenue is paid content, like an online course, the most important step is to collect payment from your customers.

You can use a product like Stripe’s [Payment Links](https://stripe.com/payments/payment-links) to quickly generate a link to collect payments from your users. Right after they pay, you can send a magic link to their email, allowing them to get instant access with low friction. You can even set this up to happen automatically with a tool like [Zapier](https://zapier.com/) or [Pipedream](https://pipedream.com/), so you barely need to write any code.

## **Augment forgot password flows**

While it may seem like magic links and passwords are at odds with one another, that isn’t entirely true. The experience of magic links is often… magical, but there are times where your users may not want them. 

As one example, if you have a password manager, managing passwords isn’t that big of a deal. You go to your login page, wait a second, the form fills in automatically and you are logged in. This is contrasted with waiting for an email to show up before you can log in.

Your user base isn’t going to be made up of only one type of user, and understanding what they prefer is key to reducing churn.

The workflow for password resets, however, is often painful. A user needs to:

1. Enter their email address
2. Wait for an email to show up
3. Click the link
4. Enter a new password for their account
5. Use that new password to log in

You probably noticed that up until step 3, the process is the same as a magic link, and then we just ask the user to do more work.

If you’ve been in this position before, sometimes you just want to click a button that says “I don’t want to make a new password, just let me log in” - and it turns out, that’s what a magic link is.

![Reset password or magic link](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8gikhsnxcbrhmvr6d20y.png)

In PropelAuth, we host authentication UIs for our customers. If they enable both password and magic link support, we automatically provide both options on the Reset Password screen so your users can choose which option they prefer. Most commonly, users choose magic links over resetting their password.

## PropelAuth makes all of this easy

At [PropelAuth](https://www.propelauth.com/), we make it easy for you to add authentication and authorization to your products. Magic links are just one of the authentication options we support, and you don’t have to worry about setting up an email provider to use them. If you want to learn more, check us out [here](https://www.propelauth.com/).

## Conclusion

These five uses of magic links can help improve the user experience, increase security, and streamline various business processes. By using magic links, businesses can eliminate or reduce the need for passwords and other forms of authentication, making it easier for users to access and use their services.