swelham / ueberauth_microsoft

Microsoft Strategy for Überauth
MIT License
37 stars 35 forks source link

Parse scopes to match Ueberauth typespec #48

Closed bismark closed 2 years ago

bismark commented 2 years ago

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.

swelham commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

That's great, thanks so much 👍