Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.2 version requires session configuration when using API strategy #314

Closed
Viliasas opened this issue Oct 12, 2022 · 3 comments · Fixed by #317
Closed

7.2 version requires session configuration when using API strategy #314

Viliasas opened this issue Oct 12, 2022 · 3 comments · Fixed by #317
Assignees
Milestone

Comments

@Viliasas
Copy link

Viliasas commented Oct 12, 2022

SDK Version

7.0

PHP Version

PHP 8.1

Composer Version

2.x

What happened?

After updating "auth0/login" package to 7.2 version website broke. We are using "API" strategy and with this version we started getting this error:

RuntimeException: Session store not set on request. in C:\project\vendor\laravel\framework\src\Illuminate\Http\Request.php:559
Stack trace:
#0 C:\project\vendor\auth0\login\src\Store\LaravelSession.php(135): Illuminate\Http\Request->session()
#1 C:\project\vendor\auth0\login\src\Store\LaravelSession.php(121): Auth0\Laravel\Store\LaravelSession->getStore()
#2 C:\project\vendor\auth0\login\src\Store\LaravelSession.php(76): Auth0\Laravel\Store\LaravelSession->boot()
#3 C:\project\vendor\auth0\auth0-php\src\Utility\TransientStoreHandler.php(108): Auth0\Laravel\Store\LaravelSession->get('nonce', NULL)
#4 C:\project\vendor\auth0\auth0-php\src\Auth0.php(198): Auth0\SDK\Utility\TransientStoreHandler->getOnce('nonce')
#5 C:\project\app\Auth\CustomAuth0Guard.php(72): Auth0\SDK\Auth0->decode('...', NULL, NULL, NULL, NULL, NULL, NULL, 2)
#6 C:\project\vendor\laravel\framework\src\Illuminate\Auth\AuthManager.php(336): App\Auth\CustomAuth0Guard->user()
#7 C:\project\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php(338): Illuminate\Auth\AuthManager->__call('user', Array)
#8 C:\project\app\Logging\Processors\GelfCustomProcessor.php(14): Illuminate\Support\Facades\Facade::__callStatic('user', Array)
#9 C:\project\vendor\monolog\monolog\src\Monolog\Handler\ProcessableHandlerTrait.php(63): App\Logging\Processors\GelfCustomProcessor->__invoke(Array)
#10 C:\project\vendor\monolog\monolog\src\Monolog\Handler\AbstractProcessingHandler.php(43): Monolog\Handler\AbstractProcessingHandler->processRecord(Array)
#11 C:\project\vendor\monolog\monolog\src\Monolog\Logger.php(379): Monolog\Handler\AbstractProcessingHandler->handle(Array)
#12 C:\project\vendor\monolog\monolog\src\Monolog\Logger.php(587): Monolog\Logger->addRecord(200, 'Request started...', Array)
#13 C:\project\vendor\laravel\framework\src\Illuminate\Log\Logger.php(183): Monolog\Logger->info('Request started...', Array)
#14 C:\project\vendor\laravel\framework\src\Illuminate\Log\Logger.php(130): Illuminate\Log\Logger->writeLog('info', 'Request started...', Array)
#15 C:\project\vendor\laravel\framework\src\Illuminate\Log\LogManager.php(683): Illuminate\Log\Logger->info('Request started...', Array)
#16 C:\project\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php(338): Illuminate\Log\LogManager->info('Request started...')
#17 C:\project\app\Http\Middleware\BeforeMiddleware.php(20): Illuminate\Support\Facades\Facade::__callStatic('info', Array)
#18 C:\project\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(180): App\Http\Middleware\BeforeMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#19 C:\project\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#20 C:\project\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(165): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#21 C:\project\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(134): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#22 C:\project\public\index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#23 {main}

When we downgraded package back to 7.1, issue disappeared.

How can we reproduce this issue?

We are using custom auth guard, but it seems to be connected to auth0 configuration. Try to upgrade "auth0/login" package on a system using "API" strategy.

Additional context

No response

@evansims evansims added bug and removed triage labels Oct 13, 2022
@evansims evansims added this to the 7.2.1 milestone Oct 13, 2022
@evansims evansims self-assigned this Oct 13, 2022
@evansims
Copy link
Member

Hey, @Viliasas 👋 Thanks for pointing this out — you're 100% right on that. I have a fix prepared on the main branch alongside some other improvements and bugfixes. I'll have a new release cut including those shortly.

@Viliasas
Copy link
Author

@evansims Thank you!

@fabien-lopes
Copy link

Hello @evansims,

Many thanks for your work!
I still have the following issue with the new package version 7.2.2

[2022-10-20 07:40:21] local.ERROR: Auth0\SDK\Utility\TransientStoreHandler::__construct(): Argument #1 ($store) must be of type Auth0\SDK\Contract\StoreInterface, null given, called in /Users/fabienlopes/code/onboarding-back/vendor/auth0/auth0-php/src/Auth0.php on line 607 {"exception":"[object] (TypeError(code: 0): Auth0\\SDK\\Utility\\TransientStoreHandler::__construct(): Argument #1 ($store) must be of type Auth0\\SDK\\Contract\\StoreInterface, null given, called in /Users/fabienlopes/code/onboarding-back/vendor/auth0/auth0-php/src/Auth0.php on line 607 at /Users/fabienlopes/code/onboarding-back/vendor/auth0/auth0-php/src/Utility/TransientStoreHandler.php:24) [stacktrace] #0 /Users/fabienlopes/code/onboarding-back/vendor/auth0/auth0-php/src/Auth0.php(607): Auth0\\SDK\\Utility\\TransientStoreHandler->__construct(NULL) #1 /Users/fabienlopes/code/onboarding-back/vendor/auth0/auth0-php/src/Auth0.php(198): Auth0\\SDK\\Auth0->getTransientStore() #2 /Users/fabienlopes/code/onboarding-back/vendor/auth0/login/src/Auth/Guard.php(175): Auth0\\SDK\\Auth0->decode('eyJhbGciOiJSUzI...', NULL, NULL, NULL, NULL, NULL, NULL, 2) #3 /Users/fabienlopes/code/onboarding-back/vendor/auth0/login/src/Auth/Guard.php(72): Auth0\\Laravel\\Auth\\Guard->getUserFromToken() #4 /Users/fabienlopes/code/onboarding-back/vendor/auth0/login/src/Http/Middleware/Stateless/Authorize.php(30): Auth0\\Laravel\\Auth\\Guard->user() #5 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Auth0\\Laravel\\Http\\Middleware\\Stateless\\Authorize->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #6 /Users/fabienlopes/code/onboarding-back/vendor/tomlerendu/laravel-convert-case-middleware/src/ConvertRequestToSnakeCase.php(26): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #7 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): TomLerendu\\LaravelConvertCaseMiddleware\\ConvertRequestToSnakeCase->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #8 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #9 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #10 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(126): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #11 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(102): Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequest(Object(Illuminate\\Http\\Request), Object(Closure), Array) #12 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(54): Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequestUsingNamedLimiter(Object(Illuminate\\Http\\Request), Object(Closure), 'api', Object(Closure)) #13 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Routing\\Middleware\\ThrottleRequests->handle(Object(Illuminate\\Http\\Request), Object(Closure), 'api') #14 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #15 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Routing/Router.php(726): Illuminate\\Pipeline\\Pipeline->then(Object(Closure)) #16 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Routing/Router.php(703): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request)) #17 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Routing/Router.php(667): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route)) #18 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Routing/Router.php(656): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request)) #19 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(190): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request)) #20 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request)) #21 /Users/fabienlopes/code/onboarding-back/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(66): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #22 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #23 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #24 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #25 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #26 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #27 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #28 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #29 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #30 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #31 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #32 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #33 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #34 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #35 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #36 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #37 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(62): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #38 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #39 /Users/fabienlopes/code/onboarding-back/vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/ClockworkMiddleware.php(24): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #40 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Clockwork\\Support\\Laravel\\ClockworkMiddleware->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #41 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #42 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\\Pipeline\\Pipeline->then(Object(Closure)) #43 /Users/fabienlopes/code/onboarding-back/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(134): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request)) #44 /Users/fabienlopes/code/onboarding-back/public/index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request)) #45 /Users/fabienlopes/.composer/vendor/laravel/valet/server.php(234): require('/Users/fabienlo...') #46 {main} "}

Any idea or fix for this bug ?

many thanks for your help!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants