Current section

19 Versions

Jump to

Compare versions

5 files changed
+14 additions
-13 deletions
  @@ -66,7 +66,7 @@ For an example implementation see the [Überauth Example](https://github.com/ueb
66 66
67 67 ## Calling
68 68
69 - Depending on the configured url you can initial the request through:
69 + Depending on the configured url you can initiate the request through:
70 70
71 71 /auth/google
72 72
  @@ -79,16 +79,16 @@ By default the requested scope is "email". Scope can be configured either explic
79 79 ```elixir
80 80 config :ueberauth, Ueberauth,
81 81 providers: [
82 - google: {Ueberauth.Strategy.Google, [default_scope: "emails profile plus.me"]}
82 + google: {Ueberauth.Strategy.Google, [default_scope: "email profile plus.me"]}
83 83 ]
84 84 ```
85 85
86 - You can also pass options such as the `hd` parameter to limit sign-in to a particular Google Apps hosted domain, or `approval_prompt` and `access_type` options to request refresh_tokens and offline access.
86 + You can also pass options such as the `hd` parameter to limit sign-in to a particular Google Apps hosted domain, or `prompt` and `access_type` options to request refresh_tokens and offline access.
87 87
88 88 ```elixir
89 89 config :ueberauth, Ueberauth,
90 90 providers: [
91 - google: {Ueberauth.Strategy.Google, [hd: "example.com", approval_prompt: "force", access_type: "offline"]}
91 + google: {Ueberauth.Strategy.Google, [hd: "example.com", prompt: "select_account", access_type: "offline"]}
92 92 ]
93 93 ```
  @@ -3,13 +3,13 @@
3 3 {<<"description">>,<<"An Uberauth strategy for Google authentication.">>}.
4 4 {<<"elixir">>,<<"~> 1.3">>}.
5 5 {<<"files">>,
6 - [<<"lib/ueberauth/strategy/google.ex">>,
6 + [<<"lib">>,<<"lib/ueberauth">>,<<"lib/ueberauth/strategy">>,
7 + <<"lib/ueberauth/strategy/google">>,<<"lib/ueberauth/strategy/google.ex">>,
7 8 <<"lib/ueberauth/strategy/google/oauth.ex">>,<<"lib/ueberauth_google.ex">>,
8 9 <<"mix.exs">>,<<"README.md">>,<<"LICENSE">>]}.
9 10 {<<"licenses">>,[<<"MIT">>]}.
10 11 {<<"links">>,
11 12 [{<<"GitHub">>,<<"https://github.com/ueberauth/ueberauth_google">>}]}.
12 - {<<"maintainers">>,[<<"Sean Callan">>]}.
13 13 {<<"name">>,<<"ueberauth_google">>}.
14 14 {<<"requirements">>,
15 15 [[{<<"app">>,<<"oauth2">>},
  @@ -22,4 +22,4 @@
22 22 {<<"optional">>,false},
23 23 {<<"repository">>,<<"hexpm">>},
24 24 {<<"requirement">>,<<"~> 0.4">>}]]}.
25 - {<<"version">>,<<"0.7.0">>}.
25 + {<<"version">>,<<"0.8.0">>}.
  @@ -15,17 +15,18 @@ defmodule Ueberauth.Strategy.Google do
15 15 def handle_request!(conn) do
16 16 scopes = conn.params["scope"] || option(conn, :default_scope)
17 17
18 - opts =
18 + params =
19 19 [scope: scopes]
20 20 |> with_optional(:hd, conn)
21 - |> with_optional(:approval_prompt, conn)
21 + |> with_optional(:prompt, conn)
22 22 |> with_optional(:access_type, conn)
23 23 |> with_param(:access_type, conn)
24 24 |> with_param(:prompt, conn)
25 25 |> with_param(:state, conn)
26 - |> Keyword.put(:redirect_uri, callback_url(conn))
27 26
28 - redirect!(conn, Ueberauth.Strategy.Google.OAuth.authorize_url!(opts))
27 + opts = [redirect_uri: callback_url(conn)]
28 +
29 + redirect!(conn, Ueberauth.Strategy.Google.OAuth.authorize_url!(params, opts))
29 30 end
30 31
31 32 @doc """
  @@ -29,8 +29,8 @@ defmodule Ueberauth.Strategy.Google.OAuth do
29 29
30 30 opts =
31 31 @defaults
32 - |> Keyword.merge(config)
33 32 |> Keyword.merge(opts)
33 + |> Keyword.merge(config)
34 34
35 35 OAuth2.Client.new(opts)
36 36 end
  @@ -1,7 +1,7 @@
1 1 defmodule UeberauthGoogle.Mixfile do
2 2 use Mix.Project
3 3
4 - @version "0.7.0"
4 + @version "0.8.0"
5 5 @url "https://github.com/ueberauth/ueberauth_google"
6 6
7 7 def project do