fix auth
This commit is contained in:
2
auth.py
2
auth.py
@ -15,7 +15,7 @@ async def main():
|
|||||||
print(udid, "no auth response")
|
print(udid, "no auth response")
|
||||||
continue
|
continue
|
||||||
print(udid, "auth success")
|
print(udid, "auth success")
|
||||||
if not client.auth_check(info.user):
|
if not await client.auth_check(info.pswd):
|
||||||
code = input(f"Enter the code for {udid}: ")
|
code = input(f"Enter the code for {udid}: ")
|
||||||
if not await client.auth_twostep(info.user, info.pswd, code):
|
if not await client.auth_twostep(info.user, info.pswd, code):
|
||||||
print(udid, "no twostep response")
|
print(udid, "no twostep response")
|
||||||
|
|||||||
@ -27,8 +27,8 @@ class IPAToolClient(BaseAsyncClient):
|
|||||||
return json_data
|
return json_data
|
||||||
return False
|
return False
|
||||||
|
|
||||||
async def auth_check(self, user: str) -> bool:
|
async def auth_check(self, keychain: str) -> bool:
|
||||||
r = await self._post("/auth/check", params={"user": user})
|
r = await self._post("/auth/check", params={"keychain": keychain})
|
||||||
if r.status != 200:
|
if r.status != 200:
|
||||||
return False
|
return False
|
||||||
json_data = await r.json()
|
json_data = await r.json()
|
||||||
|
|||||||
Reference in New Issue
Block a user