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 yesterday

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 37% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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

2420d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2d71921deadf27aec22ee95ba82b065018bec916a693cd55524bc0ee8099ca47?d=identicon)[seanjermey](/maintainers/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

[jamesedmonston/graphql-authentication

GraphQL authentication for your headless Craft CMS applications.

2917.0k](/packages/jamesedmonston-graphql-authentication)[verbb/knock-knock

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

17122.8k7](/packages/verbb-knock-knock)[matt-west/craft-recaptcha

Integrate Google’s reCAPTCHA into your forms.

1959.9k1](/packages/matt-west-craft-recaptcha)[thejoshsmith/craft-fab-permissions

Give yourself better control over your sections with Craft Field and Tab (FAB) Permissions. Restrict which tabs and fields are visible to different user groups.

1611.5k](/packages/thejoshsmith-craft-fab-permissions)

PHPackages © 2026

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