You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Supplying a bot token xoxb- has the side effect that "has_2fa" is not included in the response from Slack's users.list API. Though this is not documented, it has been confirmed by slack support
has_2fa parameter only shows if the person calling that endpoint is an Admin or Owner, and using a user token(starting with xoxp), and not a bot token(starting with xoxb).
In cases where has_2fa is missing from the response, GetUsersContext returns false for all users even though it may be enabled for some.
Expected behavior
has_2fa shouldn't default to false
Steps to reproduce
Configure the SDK with a bot token with the users:read scope. GetUsersContext will default to false for has_2fa.
Versions
Go: 1.19.2
slack-go/slack: 0.11.3
The text was updated successfully, but these errors were encountered:
I can confirm that I see the same behavior when querying the Slack API. The easiest fix would be to follow what the go-github community SDK follows and use pointers with omitempty for all JSON tags of response bodies.
What happened
Supplying a bot token
xoxb-
has the side effect that "has_2fa" is not included in the response from Slack'susers.list
API. Though this is not documented, it has been confirmed by slack supportIn cases where
has_2fa
is missing from the response, GetUsersContext returnsfalse
for all users even though it may be enabled for some.Expected behavior
has_2fa
shouldn't default tofalse
Steps to reproduce
Configure the SDK with a bot token with the
users:read
scope.GetUsersContext
will default tofalse
forhas_2fa
.Versions
The text was updated successfully, but these errors were encountered: