Search by

zwo3 / fe-magiclink

ga@zwo3.de

Passwordless frontend login for TYPO3 via magic link sent by e-mail

Package info

github.com/Gregor-Agnes/fe_magiclink

Homepage

Type:typo3-cms-extension

pkg:composer/zwo3/fe-magiclink

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.1.1 2026-12-03 14:56 UTC

This package is auto-updated.

Last update: 2026-12-03 15:08:30 UTC


README

Frontend users log in with their e-mail address and a one-time link instead of a password.

  1. The visitor enters an e-mail address into a form. It is matched with the username or with the email field of the frontend user, depending on the plugin setting.
  2. If an account exists, an e-mail with a login link is sent.
  3. The link opens a confirmation page; confirming logs the user in like a regular frontend login.

Requires TYPO3 13.4 or 14, PHP 8.2+.

Installation

composer require zwo3/fe-magiclink

Then run the database schema update (typo3 extension:setup or the Install Tool).

Usage

Add the content element Magic Link Login to a page and configure it:

Setting Description
Storage folders of the frontend users Required. Only users in these folders can log in. Without a folder nobody can log in.
Where is the e-mail address stored? In the username (default) or In the field "E-Mail". The address entered by the visitor is compared with this field, and the login link is sent to it.
Target page after login Page the user is redirected to after logging in. Default: the page with the plugin.
Login after clicking the link Confirm with a button (default) or Log in automatically, see below.

If several frontend users in the selected folders share the same address (the email field is not unique, and a username can exist in more than one folder), no link is sent. This is logged as a warning with the user IDs.

If the visitor is logged in, the plugin shows the username and a Log out button instead of the form. Logging out ends the session and returns to the page with the plugin.

Further settings can be set in TypoScript as plugin.tx_femagiclink_login.settings.*:

Setting Default Description
tokenLifetime 900 Seconds a link stays valid.
rateLimitWindow 900 Window in seconds for the two limits below.
maxRequestsPerUser 3 Links per user within the window.
maxRequestsPerIp 10 Links per client IP within the window.

The e-mail uses the Fluid template Templates/Email/FeMagiclink and the core SystemEmail layout. To change it, register your own path in $GLOBALS['TYPO3_CONF_VARS']['MAIL']['templateRootPaths'] with a key above 700.

Styling

The extension ships neutral default styles (grey buttons, visible focus rings, 44px touch targets). The font is inherited from the site. Everything is scoped to .fe-magiclink; nothing outside of it is touched. Buttons and links styled as buttons use cursor: pointer. The styles are written with Tailwind's @apply (prefix fml, no preflight) in Resources/Private/Frontend/FeMagiclink.css.

Change the look with CSS variables, no need to override single rules:

.fe-magiclink {
    --fe-magiclink-accent: #0f766e;        /* button colour */
    --fe-magiclink-accent-hover: #115e59;
    --fe-magiclink-focus: #0f766e;         /* focus ring */
    --fe-magiclink-radius: 0;
}

Available variables: --fe-magiclink-accent, -accent-hover, -accent-contrast, -surface, -muted-surface, -border, -border-hover, -error, -error-surface, -focus, -radius.

The component classes (fe-magiclink__form, __field, __label, __input, __button, __button--secondary, __message, __message--error, __heading, __text, __link) have a specificity of one class, so a rule with two classes in your own CSS overrides them. To replace the styles completely, remove the asset in your template override of Layouts/Default.html.

Security notes

  • Only a SHA-256 hash of the token is stored. Tokens are 256 bit random, expire and can be used once; redeeming is an atomic database update.
  • The form answers identically for existing, unknown and disabled accounts and when a rate limit is hit, so it does not reveal which addresses are registered. The e-mail is only sent for existing accounts, so response times can still differ slightly; use a mail spool (MAIL/transport_spool_type) to even that out.
  • Mail scanners (e.g. Microsoft Safe Links) open links in advance. Opening the link only shows a confirmation page, the token is redeemed by the form on that page. With Log in automatically a script submits the form, which makes a single click unnecessary but does not protect against scanners that execute JavaScript.
  • The login runs through TYPO3's authentication service chain, including the core request token check, session regeneration and login events.
  • The client IP is only stored as an HMAC (keyed with the encryption key) for rate limiting. Expired tokens are deleted one day after expiry, whenever the next link is requested.

Development

The frontend (Tailwind CSS 4, prefix fml:, no preflight) is built with Vite. The built files in Resources/Public/Vite/ are committed.

npm install
npm run build