Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Unhandled error when session is empty #12

Description

@pablorsk

Describe the bug
An unhandled error occurs when session is expired or empty on TwoFactorChallenge.php:102, becasue $user never is set and, accordingly, is not possible to return variable.

To Reproduce
Steps to reproduce the behavior:

  1. Log in and will be redirect to /two-factor-challenge.
  2. Clear your session data.
  3. Put some Code
  4. You see an unhandler error.

Expected behavior
Log in error.

Additional context

Undefined variable $user

On /app/vendor/webbingbrasil/filament-2fa/src/Http/Livewire/Auth/TwoFactorChallenge.php:102 (code 0)
Stacktrace:
#0 /app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(266): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /app/vendor/webbingbrasil/filament-2fa/src/Http/Livewire/Auth/TwoFactorChallenge.php(102): Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap{closure}()
#2 /app/vendor/webbingbrasil/filament-2fa/src/Http/Livewire/Auth/TwoFactorChallenge.php(164): Webbingbrasil\FilamentTwoFactor\Http\Livewire\Auth\TwoFactorChallenge->challengedUser()
#3 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Webbingbrasil\FilamentTwoFactor\Http\Livewire\Auth\TwoFactorChallenge->verify()
#4 /app/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()
#5 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#6 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#7 /app/vendor/livewire/livewire/src/ComponentConcerns/HandlesActions.php(149): Illuminate\Container\BoundMethod::call()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions