Skip to content

Commit de7f310

Browse files
committed
Fix warning
1 parent 866ceb7 commit de7f310

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

lib/ueberauth/strategy/github.ex

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,12 @@ defmodule Ueberauth.Strategy.Github do
8787
"""
8888
def handle_request!(conn) do
8989
scopes = conn.params["scope"] || option(conn, :default_scope)
90-
opts = [ scope: scopes ]
91-
if conn.params["state"], do: opts = Keyword.put(opts, :state, conn.params["state"])
92-
opts = Keyword.put(opts, :redirect_uri, callback_url(conn))
93-
module = option(conn, :oauth2_module)
90+
opts = [redirect_uri: callback_url(conn), scope: scopes]
91+
92+
opts =
93+
if conn.params["state"], do: Keyword.put(opts, :state, conn.params["state"]), else: opts
9494

95+
module = option(conn, :oauth2_module)
9596
redirect!(conn, apply(module, :authorize_url!, [opts]))
9697
end
9798

0 commit comments

Comments
 (0)