Comments (10)
Run php artisan route:cache -vvv
and post the output.
from laravel-spark-google2fa.
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.
Hmm, I don't think it's from the package. What other routes do you have ?
from laravel-spark-google2fa.
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.
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.
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.
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.
Yes, that fixes the issue!
from laravel-spark-google2fa.
I'll update the package latter today with this fix.
from laravel-spark-google2fa.
Thanks @cretueusebiu, you have been incredibly helpful :)
from laravel-spark-google2fa.
Related Issues (16)
- New Spark (with Vue 2.*) Support HOT 1
- No hint path defined for [google2fa] HOT 3
- Activating 2fa on spark results in error HOT 4
- Add views to publishing HOT 1
- Spark 7.0 compatibility HOT 1
- Error with PragmaRX\Google2FA
- Service Provider Not Found HOT 3
- Laravel 5.5 and Spark 5.03 - unable to make it work HOT 1
- I can't get the 2fa auth panel appear HOT 12
- The code is invalid HOT 4
- Migration clashes
- [PROPOSAL] Allow enter key to submit verify qr code form HOT 2
- Invalid Barcode caused by spaces in $details['vendor'] HOT 1
- Getting this error after install HOT 1
- Spark 3.0 Compatability HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-spark-google2fa.