Skip to content

Commit

Permalink
chore(slack): Bearer token inside HTTP headers
Browse files Browse the repository at this point in the history
* Slack provider: Works with Bearer token inside HTTP headers instead of params
# Deprecating usage of token as a query string parameter in Web API requests: Apps created after February 24, 2021 may no longer send tokens as query parameters and must instead use an HTTP authorization header or send the token in an HTTP POST body.

* fix: (slack provider) add Bearer token
  • Loading branch information
kaajavi authored Apr 19, 2021
1 parent 24383cc commit 53c5434
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Fred Palmer
Fábio Santos
George Whewell
Griffith Rees
Guignard Javier
Guilhem Saurel
Guillaume Vincent
Guoyu Hao
Expand Down
3 changes: 2 additions & 1 deletion allauth/socialaccount/providers/slack/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def complete_login(self, request, app, token, **kwargs):

def get_data(self, token):
# Verify the user first
resp = requests.get(self.identity_url, params={"token": token})
hed = {'Authorization': 'Bearer ' + token}
resp = requests.get(self.identity_url, headers=hed)
resp = resp.json()

if not resp.get("ok"):
Expand Down

0 comments on commit 53c5434

Please sign in to comment.