Skip to content
Open
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
11 changes: 8 additions & 3 deletions lib/ueberauth/strategy/slack_v2.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ defmodule Ueberauth.Strategy.SlackV2 do
uid_field: :email,
default_scope: "users:read",
default_user_scope: "",
oauth2_module: Ueberauth.Strategy.SlackV2.OAuth,
ignores_csrf_attack: true
oauth2_module: Ueberauth.Strategy.SlackV2.OAuth

alias Ueberauth.Auth.Info
alias Ueberauth.Auth.Credentials
Expand All @@ -36,7 +35,13 @@ defmodule Ueberauth.Strategy.SlackV2 do
opts = [scope: scopes, user_scope: user_scopes]

opts =
if conn.params["state"], do: Keyword.put(opts, :state, conn.params["state"]), else: opts
if conn.params["state"] do
opts
|> Keyword.put(:state, conn.params["state"])
else
opts
|> with_state_param(conn)
end

team = option(conn, :team)
opts = if team, do: Keyword.put(opts, :team, team), else: opts
Expand Down