Refactor the authentication in the chore script by removing the 'token' field from the payload and including it in the header as 'Authorization'. This change enhances security practices by aligning with standard HTTP authorization protocols.
This commit is contained in:
parent
623115295a
commit
1df648ca81
1 changed files with 1 additions and 1 deletions
|
@ -29,7 +29,6 @@ CHORES = (
|
|||
due_date = (datetime.utcnow() + timedelta(days=EXPIRY_DAYS)).isoformat()
|
||||
|
||||
payload = {
|
||||
"token": TOKEN,
|
||||
"title": "Weekly Chores",
|
||||
"body": CHORES,
|
||||
"due_date": due_date,
|
||||
|
@ -41,6 +40,7 @@ if ASSIGNEES:
|
|||
headers = {
|
||||
"Content-Type": "application/json",
|
||||
"Accept": "application/json",
|
||||
"Authorization": "token " + TOKEN,
|
||||
}
|
||||
|
||||
request = urllib.request.Request(
|
||||
|
|
Loading…
Reference in a new issue