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 2w 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

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

2468d 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

[jamesedmonston/graphql-authentication

GraphQL authentication for your headless Craft CMS applications.

2917.3k](/packages/jamesedmonston-graphql-authentication)[saccilottoconsulting/craft-internal-assets

A simple plugin to restrict access to assets for permitted users only. Access to a given asset is only granted if the user has view-permissions for the given source (this can be set in the user- or group-settings). The asset source folder should be moved out of the web root folder so the files are never accessible without this plugin.

353.5k](/packages/saccilottoconsulting-craft-internal-assets)[tomdiggle/craft-gatekeeper

Protect your Craft CMS website from access with a universal password.

109.3k](/packages/tomdiggle-craft-gatekeeper)

PHPackages © 2026

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