Skip to content

Commit

Permalink
Merge branch 'main' of github.com:vormkracht10/filament-two-factor-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa committed Aug 16, 2024
2 parents 42ff184 + 0b7bb57 commit ffbe6ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
10 changes: 4 additions & 6 deletions src/Listeners/SendTwoFactorCodeListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

namespace Vormkracht10\TwoFactorAuth\Listeners;

use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Vormkracht10\TwoFactorAuth\Notifications\SendOTP;
use Laravel\Fortify\Events\TwoFactorAuthenticationEnabled;
use Laravel\Fortify\Events\TwoFactorAuthenticationChallenged;
use Laravel\Fortify\Events\TwoFactorAuthenticationEnabled;
use Vormkracht10\TwoFactorAuth\Notifications\SendOTP;

class SendTwoFactorCodeListener
{
Expand All @@ -21,8 +19,8 @@ public function __construct()
/**
* Handle the event.
*/
public function handle(TwoFactorAuthenticationChallenged|TwoFactorAuthenticationEnabled $event): void
public function handle(TwoFactorAuthenticationChallenged | TwoFactorAuthenticationEnabled $event): void
{
$event->user->notify(app(SendOTP::class));
}
}
}
10 changes: 5 additions & 5 deletions src/Notifications/SendOTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Vormkracht10\TwoFactorAuth\Actions\GenerateOTP;
use Vormkracht10\TwoFactorAuth\Enums\TwoFactorType;
use Illuminate\Notifications\Notification;
use PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException;
use PragmaRX\Google2FA\Exceptions\InvalidCharactersException;
use PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException;
use PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException;
use Vormkracht10\TwoFactorAuth\Actions\GenerateOTP;
use Vormkracht10\TwoFactorAuth\Enums\TwoFactorType;

class SendOTP extends Notification implements ShouldQueue
{
Expand Down Expand Up @@ -64,7 +64,7 @@ public function toArray(object $notifiable): array
*/
public function getTwoFactorCode(User $notifiable): ?string
{
if (!$notifiable->two_factor_secret) {
if (! $notifiable->two_factor_secret) {
return null;
}

Expand Down

0 comments on commit ffbe6ab

Please sign in to comment.