mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Refactor email authentication to issue codes randomly instead of TOTPs
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
namespace Filament\Tests\Database\Factories;
|
||||
|
||||
use Filament\Auth\MultiFactor\App\AppAuthentication;
|
||||
use Filament\Auth\MultiFactor\Email\EmailAuthentication;
|
||||
use Filament\Tests\Fixtures\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
@@ -26,10 +25,8 @@ class UserFactory extends Factory
|
||||
|
||||
public function hasEmailAuthentication(): self
|
||||
{
|
||||
$emailAuthentication = EmailAuthentication::make();
|
||||
|
||||
return $this->state(fn (): array => [
|
||||
'email_authentication_secret' => $emailAuthentication->generateSecret(),
|
||||
'has_email_authentication' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ return new class extends Migration
|
||||
Schema::table('users', function (Blueprint $table): void {
|
||||
$table->after('password', function (Blueprint $table): void {
|
||||
$table->json('json')->nullable();
|
||||
$table->string('email_authentication_secret')->nullable();
|
||||
$table->boolean('has_email_authentication')->default(false);
|
||||
$table->string('app_authentication_secret')->nullable();
|
||||
$table->text('app_authentication_recovery_codes')->nullable();
|
||||
});
|
||||
@@ -28,7 +28,8 @@ return new class extends Migration
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table): void {
|
||||
$table->dropColumn([
|
||||
'email_authentication_secret',
|
||||
'json',
|
||||
'has_email_authentication',
|
||||
'app_authentication_secret',
|
||||
'app_authentication_recovery_codes',
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user