<commit_before>---
title: Using Passwordless Authentication with a magic link via email on Regular Web Apps
---
# Passwordless Authentication with a magic link via e-mail on Regular Web Apps

<%= include('../../_introduction-email-magic-link') %>

## Setup

<%= include('../../_setup-email') %>

<%= include('../../_setup-callback', {spa:false} ) %>

## Implementation

### Use Lock (the Auth0 UI widget)

<%= include('../../_init-passwordless-lock') %>

Then you can trigger the login using the `callbackURL` option to specify the endpoint that will handle the authentication on the server-side:

```html
<script src="${lock_url}"></script>
<script type="text/javascript">
  function login() {
    var lock = new Auth0LockPasswordless('${account.clientId}', '${account.namespace}', {
      passwordlessMethod: "link",              // Sets Lock to use magic link
      auth: {
        redirectUrl: '${account.callback}'       
      }
    });
    
    lock.show();
  }
</script>
<a href="javascript:login()">Login</a>
```
<commit_msg>Update index.md<commit_after>---
title: Using Passwordless Authentication with a magic link via email on Regular Web Apps
---
# Passwordless Authentication with a magic link via e-mail on Regular Web Apps

<%= include('../../_introduction-email-magic-link') %>

## Setup

<%= include('../../_setup-email') %>

<%= include('../../_setup-callback', {spa:false} ) %>

## Implementation

### Use Lock (the Auth0 UI widget)

<%= include('../../_init-passwordless-lock') %>

Then you can trigger the login using the `callbackURL` option to specify the endpoint that will handle the authentication on the server-side:

```html
<script src="${lock_url}"></script>
<script type="text/javascript">
  function login() {
    var lock = new Auth0LockPasswordless('${account.clientId}', '${account.namespace}', {
      passwordlessMethod: "link",              // Sets Lock to use magic link
      auth: {
        redirectUrl: '${account.callback}',
        responseType: 'code'
      }
    });
    
    lock.show();
  }
</script>
<a href="javascript:login()">Login</a>
```

{'fraction_non_alphanumeric': 0.17152412804586717, 'fraction_numerical': 0.0019111323459149545, 'mean_word_length': 3.3625, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4443140', 'n_tokens_mistral': 627, 'n_tokens_neox': 595, 'n_words': 181}