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

Parse scopes to match Ueberauth typespec #48

Merged
merged 1 commit into from
Apr 6, 2022
Merged

Parse scopes to match Ueberauth typespec #48

merged 1 commit into from
Apr 6, 2022

Conversation

bismark
Copy link
Contributor

@bismark bismark commented Mar 14, 2022

Ueberauth.Auth.Credentials typespec indicates that Credentials.scopes should be a list of strings. This change brings this strategy in line with the behavior of other strategies e.g. Google.

NB this is a breaking change for any current users of this library which should be noted in the changelog.

[Ueberauth.Auth.Credentials](https://github.com/ueberauth/ueberauth/blob/master/lib/ueberauth/auth/credentials.ex) typespec indicates that `Credentials.scopes` should be a list of strings. This change brings this strategy in line with the behavior of other strategies e.g. [Google](https://github.com/ueberauth/ueberauth_google/blob/master/lib/ueberauth/strategy/google.ex#L83).

NB this is a breaking change for any current users of this library which should be noted in the changelog.
@swelham
Copy link
Owner

swelham commented Mar 17, 2022

Thanks for the PR and also mentioning the changelog (which I now realise I never created 😱).

This looks good to me. If you have it to hand, would it be possible for you to supply a quick before and after example of the breaking change? This would be a great help and save some time when writing up the changelog.

@bismark
Copy link
Contributor Author

bismark commented Mar 29, 2022

The change boils down to:

In the Ueberauth callback phase, the Ueberauth Auth struct changes from:

%Ueberauth.Auth{
  credentials: %Ueberauth.Auth.Credentials{
    scopes: "scope1,scope2",
    ...
  },
  ...
}

to

%Ueberauth.Auth{
  credentials: %Ueberauth.Auth.Credentials{
    scopes: ["scope1","scope2"],
    ...
  },
  ...
}

@swelham
Copy link
Owner

swelham commented Apr 6, 2022

That's great, thanks so much 👍

@swelham swelham merged commit 3f9ff9a into swelham:master Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants