(20241127) Testing GMail auth.

This commit is contained in:
2024-11-27 20:14:04 +05:30
parent 269e36ec27
commit 2e7f1cb626
9 changed files with 336 additions and 238 deletions
+14 -14
View File
@@ -6,7 +6,7 @@
DATE:
Tuesday, 12th Nov., 2024
Wednesday, 27th Nov., 2024
OBJECTIVE:
@@ -37,11 +37,6 @@ sys.path.append("..")
# To use Quart:
from quart import current_app
# The data models:
from models.data.user import (
IsSessionRequest
)
# *****************************************************************************************************************
# ***** ****
@@ -88,14 +83,19 @@ async def get_session(session_token):
:return: The info or None.
"""
session_info = await current_app.user.is_session(
db_conn = current_app.sql_reader,
request = IsSessionRequest(sessionToken = session_token),
cache = current_app.module_cache,
)
if isinstance(session_info, dict): return session_info.get("data")
else: return None
try:
raw_info = await current_app.module_cache.get(key = session_token)
session_info = {
"fullName": raw_info["value"]["full_name"],
"entityId": raw_info["value"]["entity_id"],
"billingAccountId": raw_info["value"]["billing_account_id"],
"departmentId": raw_info["value"]["department_id"],
"branchId": raw_info["value"]["branch_id"],
"industry": raw_info["value"]["industry"]
}
return session_info
except Exception as exception:
return None
# *****************************************************************************************************************