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

Recent changes break existing auth0/login configuration #664

Closed
bluehaoran opened this issue Oct 24, 2022 · 2 comments · Fixed by #665
Closed

Recent changes break existing auth0/login configuration #664

bluehaoran opened this issue Oct 24, 2022 · 2 comments · Fixed by #665
Assignees
Labels
Scope: Bug Addressing unexpected problems or unintended behavior.
Milestone

Comments

@bluehaoran
Copy link

SDK Version

8.3

PHP Version

PHP 8.1

What happened?

Recent changes to this library (#659) and to the Laravel library (auth0/login, auth0/laravel-auth0@e132b28) break backward compatibility.

SdkConfiguration::setScope() no longer handles a null empty value correctly. Although the recent change to auth0/login corrects this for anyone who installs and publishes the Laravel configuration after auth0/login:7.2.2, anyone with an existing configuration file (which would have code like this: Configuration::stringToArrayOrNull(env('AUTH0_SCOPE')),) will default their scope to null.

This library should be able to handle both empty states, empty array and null.

I suggest patching to replace if ([] === $scope) with if (empty($scope)) { in SdkConfiguration::setScope.

There may be additional test cases required here.

How can we reproduce this issue?

  • Install Laravel.
  • Composer-require auth0/auth0-php:8.3.0.
  • Composer-require auth0/login:7.1.0.
  • php artisan vendor:publish --tag=auth0-config
  • set up the rest of the app per the instructions.
  • Loosen Composer requirements to auth0/auth0-php:^8.3.0 and auth0/login:^7.1.0
  • composer update
  • confirm that Validation of "scope" was unsuccessful is reported.

Additional context

No response

@evansims evansims self-assigned this Oct 24, 2022
@evansims evansims added the Scope: Bug Addressing unexpected problems or unintended behavior. label Oct 24, 2022
@evansims evansims added this to the 8.3.6 milestone Oct 24, 2022
@evansims
Copy link
Member

evansims commented Oct 24, 2022

Hi @bluehaoran 👋 Totally in agreement, that was an oversight on my part. The changes on the Laravel side aren't BC, but the change to this SDK could potentially break old configurations. Thanks for catching that. I'll get a fix going.

@bluehaoran
Copy link
Author

Much appreciated for fixing so quickly! 🙏

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Bug Addressing unexpected problems or unintended behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants