keep up with folder auth api changes.
This commit is contained in:
parent
1a0a26d7b3
commit
593caa82ec
@ -1,5 +1,6 @@
|
|||||||
from typing import Final
|
from typing import Final
|
||||||
|
|
||||||
|
import requests
|
||||||
from pydantic import parse_obj_as
|
from pydantic import parse_obj_as
|
||||||
from pydantic.dataclasses import dataclass
|
from pydantic.dataclasses import dataclass
|
||||||
|
|
||||||
@ -75,11 +76,9 @@ class FolderApi(BaseApi):
|
|||||||
data = {"password": password}
|
data = {"password": password}
|
||||||
token_check(self.connection)
|
token_check(self.connection)
|
||||||
response = self.connection.post(url, data=data)
|
response = self.connection.post(url, data=data)
|
||||||
# stupid! always returned status code 200
|
if response.status_code == requests.codes.unauthorized:
|
||||||
self._raise_response_error(response)
|
|
||||||
data = response.json()
|
|
||||||
if data.get("status") is not True:
|
|
||||||
raise UnauthorizedException("Password is incorrect.")
|
raise UnauthorizedException("Password is incorrect.")
|
||||||
|
self._raise_response_error(response)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def acl(self, id: str, access_level: int, recursive: bool, password: str | None) -> bool:
|
def acl(self, id: str, access_level: int, recursive: bool, password: str | None) -> bool:
|
||||||
|
Loading…
Reference in New Issue
Block a user