Skip to content

Commit

Permalink
Update session auth
Browse files Browse the repository at this point in the history
  • Loading branch information
kewisch committed Mar 6, 2022
1 parent 5d08b36 commit 492f50e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyamo/review.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def decide(self, action, comments, versions=None, versionids=None):

def flags(self, flags=None):
url = AMO_REVIEWERS_API_BASE + '/addon/%s/flags/' % self.addonid
headers = {'Authorization': 'Bearer ' + self.api_token}
headers = {'Authorization': 'Session ' + self.session.cookies.get('sessionid')}
req = self.session.patch(url, json=flags or {}, headers=headers, allow_redirects=False)
print(req.json())
if not req.status_code == 200:
Expand All @@ -232,7 +232,7 @@ def flags(self, flags=None):

def admin_disable(self):
url = AMO_REVIEWERS_API_BASE + '/addon/%s/disable/' % self.addonid
headers = {'Authorization': 'Bearer ' + self.api_token}
headers = {'Authorization': 'Session ' + self.session.cookies.get('sessionid')}
req = self.session.post(url, headers=headers, allow_redirects=False)
return req.status_code == 202

Expand All @@ -253,7 +253,7 @@ def subscription(self, subscribe=True):
"un" if not subscribe else "",
"un" if self.unlisted else ""
)
headers = {'Authorization': 'Bearer ' + self.api_token}
headers = {'Authorization': 'Session ' + self.session.cookies.get('sessionid')}
req = self.session.post(url, headers=headers, allow_redirects=False)
return req.status_code == 202

Expand Down

0 comments on commit 492f50e

Please sign in to comment.