Skip to content

Commit

Permalink
Update api.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferya authored Aug 16, 2024
1 parent 30fd3e9 commit 3d9521e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions rootfs/var/www/leaf-isle-bagger/drupal/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
def init_session(args, username, password):

session = requests.Session()
session.auth = (username, password)

# auth_endpoint = 'user/login?_format=json'
# response = session.post(
# urljoin(args.server, auth_endpoint),
# json={'email': username, 'pass': password},
# headers={'Content-Type': 'application/json'}
# )
# response.raise_for_status()
#session.auth = (username, password)

auth_endpoint = 'user/login?_format=json'
response = session.post(
urljoin(args.server, auth_endpoint),
json={"name": username, 'pass': password},
headers={'Content-Type': 'application/json'}
)
response.raise_for_status()

return session

Expand Down

0 comments on commit 3d9521e

Please sign in to comment.