yiirocks/voyti-2fa

Two-factor authentication subsystem for the YiiRocks Voyti Yii3 extension

Maintainers

Package info

github.com/YiiRocks/voyti-2fa

Homepage

pkg:composer/yiirocks/voyti-2fa

Transparency log

Fund package maintenance!

YiiRocks

Statistics

Installs: 78

Dependents: 3

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main / 1.0.x-dev 2026-08-11 19:39 UTC

This package is auto-updated.

Last update: 2026-08-11 19:39:32 UTC


README

The two-factor authentication base package for Voyti, the Yii3 user-management extension. It carries the whole 2FA subsystem — data, login-confirmation flow, settings screen, backup codes, and per-permission enforcement — that Voyti core no longer ships itself.

Packagist Version PHP from Packagist Packagist GitHub License GitHub Workflow Status

Stats for Nerds

Coverage MSI Tests Assertions

What this is

Two-factor authentication is pluggable in Voyti: this base package provides the machinery, and each method (email, TOTP, WebAuthn) ships as its own small package on top of it. 2FA becomes active as soon as a method package is installed — there is no separate on/off flag. It hooks into core's login flow through the voyti.login-challenge seam and auto-joins the enforcement middleware chain via the voyti.enforce-middleware tag, so a host needs no extra wiring.

Requirements

Installation

You do not install this package directly — on its own it provides no working 2FA. Install a method package instead and this base is pulled in automatically as a dependency:

The base package ships a migration creating its user_two_factor and user_backup_code tables; its migration path is registered for yiisoft/db-migration automatically, so a host's migrate command picks it up.

Documentation

Installation steps, the enforcement/config reference, and the guide to writing your own method plugin are all covered at Yii.Rocks.

Testing

# Unit tests
composer phpunit

# Mutation testing
composer infection

# Static analysis
composer psalm

# Code style fixer
composer php-cs-fixer