Giter Club home page Giter Club logo

Comments (10)

cretueusebiu avatar cretueusebiu commented on May 28, 2024

Run php artisan route:cache -vvv and post the output.

from laravel-spark-google2fa.

acoustep avatar acoustep commented on May 28, 2024

Thanks for the quick response :)


```▸ php artisan route:cache -vvv
Route cache cleared!


  [Exception]
  Serialization of 'Closure' is not allowed


Exception trace:
 () at /Users/mitch/Code/mamp/testapp/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteCacheCommand.php:95
 serialize() at /Users/mitch/Code/mamp/testapp/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteCacheCommand.php:95
 Illuminate\Foundation\Console\RouteCacheCommand->buildRouteCacheFile() at /Users/mitch/Code/mamp/testapp/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteCacheCommand.php:65
 Illuminate\Foundation\Console\RouteCacheCommand->fire() at n/a:n/a
 call_user_func_array() at /Users/mitch/Code/mamp/testapp/vendor/laravel/framework/src/Illuminate/Container/Container.php:508
 Illuminate\Container\Container->call() at /Users/mitch/Code/mamp/testapp/vendor/laravel/framework/src/Illuminate/Console/Command.php:169
 Illuminate\Console\Command->execute() at /Users/mitch/Code/mamp/testapp/vendor/symfony/console/Command/Command.php:261
 Symfony\Component\Console\Command\Command->run() at /Users/mitch/Code/mamp/testapp/vendor/laravel/framework/src/Illuminate/Console/Command.php:155
 Illuminate\Console\Command->run() at /Users/mitch/Code/mamp/testapp/vendor/symfony/console/Application.php:817
 Symfony\Component\Console\Application->doRunCommand() at /Users/mitch/Code/mamp/testapp/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at /Users/mitch/Code/mamp/testapp/vendor/symfony/console/Application.php:116
 Symfony\Component\Console\Application->run() at /Users/mitch/Code/mamp/testapp/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:121
 Illuminate\Foundation\Console\Kernel->handle() at /Users/mitch/Code/mamp/testapp/artisan:36```

from laravel-spark-google2fa.

cretueusebiu avatar cretueusebiu commented on May 28, 2024

Hmm, I don't think it's from the package. What other routes do you have ?

from laravel-spark-google2fa.

acoustep avatar acoustep commented on May 28, 2024

I have tried commenting out all of my other routes, Laravel Spark routes, and a couple of additional packages I added as well.

The only thing that removes the error is when I comment out the service provider for this package.

Digging deeper: I've gone in to the vendor code, and commenting out line 66 of Google2FAServiceProvider.php also removes the error:

$router->post('/settings/two-factor-auth', TwoFactorAuthController::class.'@enableTwoFactor');

from laravel-spark-google2fa.

cretueusebiu avatar cretueusebiu commented on May 28, 2024

If you replace:

$router->post('/settings/two-factor-auth-generate', TwoFactorAuthController::class.'@generateQrCode');
$router->post('/settings/two-factor-auth', TwoFactorAuthController::class.'@enableTwoFactor');

with

$router->post('/settings/two-factor-auth-generate', 'Eusebiu\LaravelSparkGoogle2FA\TwoFactorAuthController@generateQrCode');
$router->post('/settings/two-factor-auth', 'Eusebiu\LaravelSparkGoogle2FA\TwoFactorAuthController@enableTwoFactor');

does it work ?

from laravel-spark-google2fa.

acoustep avatar acoustep commented on May 28, 2024

No, the error is still there.

Commenting out line 96 of /spark/src/Http/routes.php which appears to be the route the package overrides also fixes the issue.

It looks other people have had similar errors when there are multiple routes with the same URL - could that be the issue? (laravel/framework#17149)

$router->post('/settings/two-factor-auth', 'Settings\Security\TwoFactorAuthController@enable');

from laravel-spark-google2fa.

cretueusebiu avatar cretueusebiu commented on May 28, 2024

Try this:

Change the second route to :

$router->post('/settings/two-factor-auth-google', TwoFactorAuthController::class.'@enableTwoFactor');

then in resources/assets/js/enable-two-factor-auth-google.js change

'/settings/two-factor-auth' to '/settings/two-factor-auth-google'

from laravel-spark-google2fa.

acoustep avatar acoustep commented on May 28, 2024

Yes, that fixes the issue!

from laravel-spark-google2fa.

cretueusebiu avatar cretueusebiu commented on May 28, 2024

I'll update the package latter today with this fix.

from laravel-spark-google2fa.

acoustep avatar acoustep commented on May 28, 2024

Thanks @cretueusebiu, you have been incredibly helpful :)

from laravel-spark-google2fa.

Related Issues (16)

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.