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
{{ message }}
Repository navigation
AsyncOAuthFlow raises UnboundLocalError on org-wide install without a bot token #1596
Use AsyncApp with OAuth and have an Enterprise Grid org install the app with only user scopes (no bot scopes). The oauth.v2.access response then has no access_token for the bot and is_enterprise_install is true.
Configure AsyncOAuthFlow with user scopes only.
Install the app at the organization level (org-wide install).
Complete the OAuth redirect.
Expected result:
The installation is saved and the redirect succeeds, the same as it does with the sync OAuthFlow.
Actual result:
AsyncOAuthFlow.run_installation in slack_bolt/oauth/async_oauth_flow.py raises:
UnboundLocalError: cannot access local variable 'auth_test' where it is not associated with a value
The code reads auth_test.get("url") for enterprise installs, but auth_test is only set when a bot token exists. The sync OAuthFlow.run_installation nests that line inside the if bot_token is not None: block, so the two have drifted apart.
I have a fix that mirrors the sync version, with tests for both, in #1590.
Requirements
I have read the Contributing guidelines and Code of Conduct.
Activity