Skip to content

Commit

Permalink
resolve PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mausamp committed Nov 28, 2024
1 parent 1f33175 commit 1159e52
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/omniauth/strategies/slack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ def identity
"user" => raw_info["user"] || raw_info["profile"],
"team" => raw_info["team"] || access_token.params["team"]
}
@identity["user"]["id"] ||= access_token.params.dig("authed_user", "id")
if authed_user_token?
@identity["user"]["id"] ||= access_token.params.dig("authed_user", "id")
end

@identity
end

Expand Down Expand Up @@ -116,8 +119,11 @@ def auth_hash
"bot_token" => access_token.token
}
creds["user_token"] = access_token.params.dig("authed_user", "access_token") if authed_user_token?
creds["expires"] = access_token.expires?
expires = access_token.expires_at.present? || access_token.expires_in.present?
creds["refresh_token"] = access_token.refresh_token if expires && access_token.refresh_token
creds["expires_at"] = access_token.expires_at if access_token.expires_at
creds["expires_in"] = access_token.expires_in if access_token.expires_in
creds["expires"] = access_token.expires?
creds
end

Expand Down

0 comments on commit 1159e52

Please sign in to comment.