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

Add support to hl param in authorization URL #102

Merged
merged 2 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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