diff --git a/libs/actions.py b/libs/actions.py index e628fb9..d1319c7 100644 --- a/libs/actions.py +++ b/libs/actions.py @@ -12,11 +12,12 @@ def login(url, pr_key, role=0, ecosystem=1): - token, uid = api.getuid(url) + token, uid, network_id = api.getuid(url) result = api.login( url=url, token=token, uid=uid, + network_id=network_id, private_key=pr_key, role_id=role, ecosystem=ecosystem diff --git a/libs/api.py b/libs/api.py index fffd85a..1ef25ba 100644 --- a/libs/api.py +++ b/libs/api.py @@ -39,11 +39,12 @@ def getuid(url): result = response.json() token = result['token'] uid = result['uid'] - return token, uid + network_id = result['network_id'] + return token, uid, network_id -def login(url, token, uid, private_key, role_id=0, ecosystem=1, expire=3600): - signature = sign(private_key, 'LOGIN' + uid) +def login(url, token, uid, network_id, private_key, role_id=0, ecosystem=1, expire=3600): + signature = sign(private_key, 'LOGIN' + network_id + uid) pubkey = get_public_key(private_key) full_token = 'Bearer ' + token data = {