alt-design/alt-google-2fa 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alt-design/alt-google-2fa

最新稳定版本:v1.1.2

Composer 安装命令:

composer require alt-design/alt-google-2fa

包简介

Alt Google 2FA addon! Uses google2fa-laravel to integrate it into Statamic.

README 文档

README

Google 2FA - just not requiring like, an hour of setup and config.

Heavily uses https://github.com/antonioribeiro/google2fa-laravel - big shout out 🫶

Features

  • Select who needs 2FA enforced by super users and roles
  • Select optional user roles that can access 2FA
  • Works on Front End and Control Panel

How to Install

composer require alt-design/alt-google-2fa

Basic usage

Settings

Just nip into the settings, few options

  • Enforced / Optional / Off
    • Enforced - Users matching the criteria have to have 2FA on to access the site.
    • Optional - As it says on the tin, the routes are available if you fancy.
    • Off - Just turns off the 2FA requirements for Super Users

Using your own template

Want to use your own template? Don't blame ya! Luckily we've built a tag in to generate the QR code. Template just needs to vaguely look like this:

<!-- QR Tag -->
<s:AltGoogle2FA /> (Blade) or {{ alt-google-2fa }} if you're using Antlers)

<!-- OTP Form ->
<form action="{{ route('alt-google-2fa.verify') }}" method="POST">
    @csrf

    <input name="one_time_password" type="text" placeholder="OTP Code">

    <button type="submit" class="btn btn-primary">Authenticate</button>
</form>

<!-- Just so people don't get stuck -->
<a href="{{ route('statamic.logout') }}"> 
    Cancel & Logout
</a>

Example manual inclusion of enabling/disabling 2FA.

{{ if {AltGoogle2FA:is-enabled} }}
    <a href="{{ route:alt-google-2fa.disable-2fa }}">Disable</a>
{{ else }}
    <a href="{{ route:alt-google-2fa.enable-2fa }}">Enable</a>
{{ /if }}

Using Database Users?

No problemo! You'll just need to publish the database migration and run it!

php artisan vendor:publish --tag=alt-google-2fa-migrations
php artisan migrate

Locked yourself out

Oop - you can just disable the settings using the content/alt-google-2fa/settings.yaml, or remove the 2FA field values on your user.

Questions etc

Drop us a big shout-out if you have any questions, comments, or concerns. We're always looking to improve our addons, so if you have any feature requests, we'd love to hear them.

Also - check out our other Statamic bits!

Starter Kits

Addons

Postcardware

Send us a postcard from your hometown if you like this addon. We love getting mail from other cool peeps!

Alt Design
St Helens House
Derby
DE1 3EE
UK

统计信息

  • 总下载量: 750
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固