From 6a647c3b8e5011e49062574b0d5fc3f338457a93 Mon Sep 17 00:00:00 2001 From: Aaron Tinio Date: Tue, 14 Nov 2023 10:17:55 +0800 Subject: [PATCH] Fix scope splitting (#104) --- CHANGELOG.md | 48 +++++++++++++++++--------------- lib/ueberauth/strategy/google.ex | 2 +- mix.exs | 2 +- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16676a3..198e003 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,35 +2,39 @@ ## (Unreleased) +## v0.12.1 + +- Fix scope splitting [104](https://github.com/ueberauth/ueberauth_google/pull/104) + ## v0.12.0 -* Add support to hl param in handle_request! [102](https://github.com/ueberauth/ueberauth_google/pull/102) +- Add support to hl param in handle_request! [102](https://github.com/ueberauth/ueberauth_google/pull/102) ## v0.11.0 -* Allow using a function to generate the client secret [101](https://github.com/ueberauth/ueberauth_google/pull/101) +- Allow using a function to generate the client secret [101](https://github.com/ueberauth/ueberauth_google/pull/101) ## v0.10.3 -* Handle `%OAuth2.Response{status_code: 503}` with no `error_description` in `get_access_token` [99](https://github.com/ueberauth/ueberauth_google/pull/99) +- Handle `%OAuth2.Response{status_code: 503}` with no `error_description` in `get_access_token` [99](https://github.com/ueberauth/ueberauth_google/pull/99) ## v0.10.2 -* Prefer Local Over Global Configuration [95](https://github.com/ueberauth/ueberauth_google/pull/95) +- Prefer Local Over Global Configuration [95](https://github.com/ueberauth/ueberauth_google/pull/95) ## v0.10.1 -* Misc doc changes [81](https://github.com/ueberauth/ueberauth_google/pull/81) -* Upgrade Ueberauth and Refactor CSRF State Logic [82](https://github.com/ueberauth/ueberauth_google/pull/82) +- Misc doc changes [81](https://github.com/ueberauth/ueberauth_google/pull/81) +- Upgrade Ueberauth and Refactor CSRF State Logic [82](https://github.com/ueberauth/ueberauth_google/pull/82) ## v0.10.0 - 2020-10-20 ### Enhancement -* Updated docs [#69](https://github.com/ueberauth/ueberauth_google/pull/69) [#70](https://github.com/ueberauth/ueberauth_google/pull/70) -* Support for birthday [#73](https://github.com/ueberauth/ueberauth_google/pull/73) -* Allow for userinfo endpoint to be configured [#75](https://github.com/ueberauth/ueberauth_google/pull/75) -* Updated plug and ueberauth packages [#76](https://github.com/ueberauth/ueberauth_google/pull/76) +- Updated docs [#69](https://github.com/ueberauth/ueberauth_google/pull/69) [#70](https://github.com/ueberauth/ueberauth_google/pull/70) +- Support for birthday [#73](https://github.com/ueberauth/ueberauth_google/pull/73) +- Allow for userinfo endpoint to be configured [#75](https://github.com/ueberauth/ueberauth_google/pull/75) +- Updated plug and ueberauth packages [#76](https://github.com/ueberauth/ueberauth_google/pull/76) Thanks goes to all the contributes @@ -38,31 +42,31 @@ Thanks goes to all the contributes ### Enhancement -* Add support for optional login_hint param [#61](https://github.com/ueberauth/ueberauth_google/pull/61) -* Use `json_library` method from Ueberauth config [#58](https://github.com/ueberauth/ueberauth_google/pull/58) -* Allows specifying `{m, f, a}` tuples for things such as Client ID +- Add support for optional login_hint param [#61](https://github.com/ueberauth/ueberauth_google/pull/61) +- Use `json_library` method from Ueberauth config [#58](https://github.com/ueberauth/ueberauth_google/pull/58) +- Allows specifying `{m, f, a}` tuples for things such as Client ID and Client Secret [#60](https://github.com/ueberauth/ueberauth_google/pull/60) -* Allows the newest oauth2 package versions with potential security fixes [#68](https://github.com/ueberauth/ueberauth_google/pull/68) +- Allows the newest oauth2 package versions with potential security fixes [#68](https://github.com/ueberauth/ueberauth_google/pull/68) ## v0.6.0 - 2017-07-18 -* Add support for `access_type` per request using `url` parameter. +- Add support for `access_type` per request using `url` parameter. ## v0.5.0 - 2016-12-27 -* Add support for new params: `access_type`, `approval_prompt`, `state`. -* Fix Elixir warnings. +- Add support for new params: `access_type`, `approval_prompt`, `state`. +- Fix Elixir warnings. ## v0.4.0 - 2016-09-21 -* Target Elixir 1.3 and greater. -* Fix OAuth bug with 0.6.0 pin. +- Target Elixir 1.3 and greater. +- Fix OAuth bug with 0.6.0 pin. ## v0.3.0 - 2016-08-15 -* Use OpenID endpoint for profile information. -* Update authorize and token URLs. +- Use OpenID endpoint for profile information. +- Update authorize and token URLs. ## v0.2.0 - 2016-12-10 -* Release 0.2.0 to follow Ueberauth. +- Release 0.2.0 to follow Ueberauth. diff --git a/lib/ueberauth/strategy/google.ex b/lib/ueberauth/strategy/google.ex index d185d4c..e78e0db 100644 --- a/lib/ueberauth/strategy/google.ex +++ b/lib/ueberauth/strategy/google.ex @@ -82,7 +82,7 @@ defmodule Ueberauth.Strategy.Google do def credentials(conn) do token = conn.private.google_token scope_string = token.other_params["scope"] || "" - scopes = String.split(scope_string, ",") + scopes = String.split(scope_string, " ") %Credentials{ expires: !!token.expires_at, diff --git a/mix.exs b/mix.exs index 671993e..eff61f0 100644 --- a/mix.exs +++ b/mix.exs @@ -2,7 +2,7 @@ defmodule UeberauthGoogle.Mixfile do use Mix.Project @source_url "https://github.com/ueberauth/ueberauth_google" - @version "0.12.0" + @version "0.12.1" def project do [