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

Use openid profile email as the default scope value [SDK-2926] #540

Merged
merged 6 commits into from
Nov 10, 2021

Conversation

Widcket
Copy link
Contributor

@Widcket Widcket commented Nov 9, 2021

Changes

⚠️ THIS PR CONTAINS BREAKING CHANGES

The library was using an assortment of different values as the default value of the scope parameter in Authentication client methods and Web Auth. The default scope value used across the library was changed to openid profile email, with the exception of the renew(withRefreshToken:scope:) method, in which it remains nil.

As the scope parameter in Authentication client methods have a default value, it is not necessary for that parameter to be optional. So it was changed to be non-optional.

Finally, in a couple of Authentication client methods, the scope and audience parameters switched places for the sake of consistency with the rest of the methods.

Testing

  • This change adds unit test coverage
  • This change has been tested on the latest version of the platform/language or why not

Checklist

@Widcket Widcket changed the base branch from master to beta November 9, 2021 01:50
@Widcket Widcket added the review:small Small review label Nov 9, 2021
@@ -19,11 +19,11 @@ struct Auth0Authentication: Authentication {
self.telemetry = telemetry
}

func login(email username: String, code otp: String, audience: String?, scope: String?) -> Request<Credentials, AuthenticationError> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With a default value, there's no point in having the scope parameter be optional.

@Widcket Widcket marked this pull request as ready for review November 10, 2021 01:40
@Widcket Widcket requested a review from a team as a code owner November 10, 2021 01:40
@Widcket Widcket merged commit 0706663 into beta Nov 10, 2021
@Widcket Widcket deleted the v2/default-scope branch November 10, 2021 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review:small Small review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants