[SDK-3585] Fix: Missing Code
error on Callback Route for Octane Customers
#297
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
This PR resolves an issue for customers using our Laravel SDK with Laravel Octane.
Bug: With this combination, upon a user returning to the callback route (
Auth0\Laravel\Http\Controller\Stateful\Callback
) they would be presented with aMissing Code
error.Cause: The underlying Auth0 PHP SDK fetches the
code
andstate
parameters of the callback using the standard PHP super global_GET
. This super global is not available when running Laravel under Octane. Within our Laravel SDK, we are (correctly) using Laravel'sIlluminate\Http\Request->query()
method to check for the presence of these values. However, we had not handed these values off directly to the underlying Auth0 PHP SDK, and instead allowed it to attempt to extract them itself from_GET
, which would fail under Octane.Fix: The Laravel SDK now correctly extracts these values using Octane-compatible Laravel APIs and hands them off to the underlying Auth0 PHP SDK directly, avoiding the conflict from the missing
_GET
super global.References
Resolves #218 (comment)
Testing
Contributor Checklist