Giter Club home page Giter Club logo

filament-2fa's Introduction

Filament 2FA Plugin

A Two Factor Authentication plugin for Filament

Installation

  1. Install the package via composer (requires filament >= 2.10.40)
composer require webbingbrasil/filament-2fa
  1. Publish assets and run migrations
php artisan vendor:publish --tag="filament-2fa-migrations"
php artisan migrate

Optionally, you can publish config or views:

php artisan vendor:publish --tag="filament-2fa-config"
php artisan vendor:publish --tag="filament-2fa-views"
  1. Add \Webbingbrasil\FilamentTwoFactor\TwoFactorAuthenticatable trait to your user model.

  2. Update the config/filament.php to point to the Two Factor Login::class.

"auth" => [
    "guard" => env("FILAMENT_AUTH_GUARD", "web"),
    "pages" => [
        "login" =>
            \Webbingbrasil\FilamentTwoFactor\Http\Livewire\Auth\Login::class,
    ],
],

Integrate With Custom Profile Page

This package has a component for two-factor setup that can be easily added to a profile page, like the one for filament-jetstream-theme.

Create a view with the <livewire:filament-two-factor-form> component like the example below:

// resources/views/partials/2fa-section.blade.php
<hr />

<x-filament-jetstream::grid-section class="mt-8">
    <x-slot name="title">
        {{ __('filament-2fa::two-factor.title') }}
    </x-slot>

    <x-slot name="description">
        {{ __('filament-2fa::two-factor.description') }}
    </x-slot>

    <div class="space-y-3">
        <x-filament::card>
            <livewire:filament-two-factor-form>
        </x-filament::card>
    </div>
</x-filament-jetstream::grid-section>

Then add the view to your profile page using render hook:

## in Service Provider file
public function boot()
{
    Filament::registerRenderHook(
        'filament-jetstream.profile-page.end',
        fn (): View => view('partials.2fa-section'),
    );
}

Screenshots

Two Factor Page Confirm Password Finishing enable Recovery codes Enabled Challenge Breezy

Credits

License

The MIT License (MIT). Please see License File for more information.

filament-2fa's People

Contributors

dmandrade avatar koupisbean avatar sh4msi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.