PHPackages                             kodal-uk/craft-email-2fa - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. kodal-uk/craft-email-2fa

ActiveCraft-plugin[Authentication &amp; Authorization](/categories/authentication)

kodal-uk/craft-email-2fa
========================

Email based Two-factor authentication plugin for Craft CMS

1.1.2(6y ago)4686[5 issues](https://github.com/kodal-uk/craft-email-2fa/issues)[3 PRs](https://github.com/kodal-uk/craft-email-2fa/pulls)MITPHP

Since Sep 13Pushed 3y ago2 watchersCompare

[ Source](https://github.com/kodal-uk/craft-email-2fa)[ Packagist](https://packagist.org/packages/kodal-uk/craft-email-2fa)[ RSS](/packages/kodal-uk-craft-email-2fa/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (6)Dependencies (1)Versions (8)Used By (0)

Email Two-Factor Authentication plugin for Craft CMS 3.x
========================================================

[](#email-two-factor-authentication-plugin-for-craft-cms-3x)

Email based Two-factor authentication plugin for Craft CMS

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 3.0.0-beta.23 or later.

Installation
------------

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
     cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
     composer require kodal/craft-email-2fa

    ```
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Email 2FA.

Restricting access to pages.
----------------------------

[](#restricting-access-to-pages)

Include `{{ requireTwoFactorLogin() }}` in the template for pages you want to require two-factor authentication. Users will be redirected to the verify page link set in the plugin settings.

`{{ requireTwoFactorLogin() }}` also calls requireLogin so logged out users will be redirected to the login form and logged in users will be redirected to the verify form.

See Craft CMS documentation for login form example

Verify email form example.
--------------------------

[](#verify-email-form-example)

```

    {{ csrfInput() }}
    {{ actionInput('email-2fa/verify') }}

        {{ 'Verification Code' | t }}

            {% for i in 1..craft.email2fa.verifyCodeLength %}

            {% endfor %}

```

Resend email form example.
--------------------------

[](#resend-email-form-example)

Optionally add a resend email link.

```

    {{ csrfInput() }}
    {{ actionInput('email-2fa/verify/resend') }}

```

Brought to you by [Kodal](https://www.kodal.uk/)

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

6

Last Release

2513d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15254335?v=4)[Sean Jermey](/maintainers/seanjermey)[@seanjermey](https://github.com/seanjermey)

---

Tags

Authenticationemail2facmstwo-factorCraftcraftcmscraft-pluginkodal

### Embed Badge

![Health badge](/badges/kodal-uk-craft-email-2fa/health.svg)

```
[![Health](https://phpackages.com/badges/kodal-uk-craft-email-2fa/health.svg)](https://phpackages.com/packages/kodal-uk-craft-email-2fa)
```

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

101400.6k78](/packages/verbb-formie)[verbb/hyper

A user-friendly links field for Craft.

24153.5k14](/packages/verbb-hyper)[verbb/vizy

A flexible visual editor field for Craft.

4251.5k1](/packages/verbb-vizy)[jamesedmonston/graphql-authentication

GraphQL authentication for your headless Craft CMS applications.

2917.9k](/packages/jamesedmonston-graphql-authentication)[verbb/events

A full-featured plugin for event management and ticketing.

2312.1k](/packages/verbb-events)[verbb/knock-knock

Password protect your public facing Craft website with a single password.

17125.6k9](/packages/verbb-knock-knock)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
