Skip to content

Commit

Permalink
Merge pull request #102 from alejandrodevs/master
Browse files Browse the repository at this point in the history
Add support to hl param in authorization URL
  • Loading branch information
yordis authored Sep 25, 2023
2 parents fcfc954 + 91784d8 commit ad1de54
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## (Unreleased)

## v0.12.0

* 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)
Expand Down
1 change: 1 addition & 0 deletions lib/ueberauth/strategy/google.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ defmodule Ueberauth.Strategy.Google do
|> with_param(:access_type, conn)
|> with_param(:prompt, conn)
|> with_param(:login_hint, conn)
|> with_param(:hl, conn)
|> with_state_param(conn)

opts = oauth_client_options_from_conn(conn)
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule UeberauthGoogle.Mixfile do
use Mix.Project

@source_url "https://github.com/ueberauth/ueberauth_google"
@version "0.11.0"
@version "0.12.0"

def project do
[
Expand Down
5 changes: 3 additions & 2 deletions test/strategy/google_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ defmodule Ueberauth.Strategy.GoogleTest do
end

test "handle_request! redirects to appropriate auth uri" do
conn = conn(:get, "/auth/google", %{})
conn = conn(:get, "/auth/google", %{hl: "es"})
# Make sure the hd and scope params are included for good measure
routes = Ueberauth.init() |> set_options(conn, hd: "example.com", default_scope: "email openid")

Expand All @@ -86,7 +86,8 @@ defmodule Ueberauth.Strategy.GoogleTest do
"redirect_uri" => "http://www.example.com/auth/google/callback",
"response_type" => "code",
"scope" => "email openid",
"hd" => "example.com"
"hd" => "example.com",
"hl" => "es"
} = Plug.Conn.Query.decode(redirect_uri.query)
end

Expand Down

0 comments on commit ad1de54

Please sign in to comment.