Skip to content

Commit

Permalink
Merge pull request #2 from bklang/feature/fix_missing_request_uri
Browse files Browse the repository at this point in the history
Slack requires a matching `redirect_uri`
  • Loading branch information
Daniel Neighman committed Nov 29, 2015
2 parents 59de460 + 0c05334 commit a55e31d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/ueberauth/strategy/slack.ex
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ defmodule Ueberauth.Strategy.Slack do
@doc false
def handle_callback!(%Plug.Conn{ params: %{ "code" => code } } = conn) do
module = option(conn, :oauth2_module)
token = apply(module, :get_token!, [[code: code]])
params = [code: code]
options = %{
options: [
client_options: [redirect_uri: callback_url(conn)]
]
}
token = apply(module, :get_token!, [params, options])

if token.access_token == nil do
set_errors!(conn, [error(token.other_params["error"], token.other_params["error_description"])])
Expand Down

0 comments on commit a55e31d

Please sign in to comment.