This commit is contained in:
parent
7937fb89d4
commit
ccfeb89e66
|
@ -23,8 +23,13 @@ async def check_auth(req):
|
||||||
if response.status != 200:
|
if response.status != 200:
|
||||||
return False, None
|
return False, None
|
||||||
r = await response.json()
|
r = await response.json()
|
||||||
|
print(r)
|
||||||
try:
|
try:
|
||||||
user_id = r.get("data", {}).get("session", {}).get("user", {}).get("id", None)
|
data = r.get("data")
|
||||||
|
is_authenticated = False
|
||||||
|
user_id = None
|
||||||
|
if data:
|
||||||
|
user_id = data.get("session", {}).get("user", {}).get("id", None)
|
||||||
is_authenticated = user_id is not None
|
is_authenticated = user_id is not None
|
||||||
return is_authenticated, user_id
|
return is_authenticated, user_id
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user