updated Service providers
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
ToDo List:
|
||||
|
||||
Redis Items:
|
||||
|
||||
Internal serves from Class inside API:
|
||||
- [ ] Save Events activities as [
|
||||
{"endpoint_code-UUID1": ["event-UUID1", "event-UUID2", "event-UUID3"]},
|
||||
{"endpoint_code-UUID2": ["event-UUID4", "event-UUID5", "event-UUID6"]}
|
||||
]
|
||||
|
||||
|
||||
- [ ] Save Application activities as [
|
||||
{"app1": ["appCode-UUID1", "appCode-UUID2", "appCode-UUID3"]},
|
||||
{"app2": ["appCode-UUID4", "appCode-UUID5", "appCode-UUID6"]}
|
||||
]
|
||||
|
||||
|
||||
Serve Only from Redis:
|
||||
- [] Endpoint: "authentication/page/valid"
|
||||
send data: {"page": "app1"}
|
||||
result: {"page": "appCode-UUID4"}
|
||||
|
||||
|
||||
Client side Frontend:
|
||||
On Redirect [send=> authentication/page/valid]
|
||||
Retrieve available application UUIDs from API
|
||||
Redirect to related page with UUID
|
||||
{
|
||||
"appCode-UUID1": App1.tsx
|
||||
}
|
||||
@@ -14,6 +14,7 @@ from ApiServices.AuthService.validations.request.authentication.login_post impor
|
||||
RequestForgotPasswordPhone,
|
||||
RequestForgotPasswordEmail,
|
||||
RequestVerifyOTP,
|
||||
RequestApplication,
|
||||
)
|
||||
from ApiServices.AuthService.events.auth.auth import AuthHandlers
|
||||
|
||||
@@ -367,7 +368,45 @@ def authentication_password_verify_otp(
|
||||
"tz": tz or "GMT+3",
|
||||
"token": token,
|
||||
}
|
||||
print('Token&OTP : ', data.otp, data.token)
|
||||
print("Token&OTP : ", data.otp, data.token)
|
||||
if not domain or not language:
|
||||
return JSONResponse(
|
||||
content={"error": "EYS_0003"},
|
||||
status_code=status.HTTP_406_NOT_ACCEPTABLE,
|
||||
headers=headers,
|
||||
)
|
||||
return JSONResponse(
|
||||
content={},
|
||||
status_code=status.HTTP_202_ACCEPTED,
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
|
||||
@auth_route.post(
|
||||
path="/page/valid",
|
||||
summary="Verify if page is valid returns application avaliable",
|
||||
description="Verify if page is valid returns application avaliable",
|
||||
)
|
||||
def authentication_page_valid(
|
||||
request: Request,
|
||||
data: RequestApplication,
|
||||
language: str = Header(None, alias="language"),
|
||||
domain: str = Header(None, alias="domain"),
|
||||
tz: str = Header(None, alias="timezone"),
|
||||
):
|
||||
"""
|
||||
Verify if page is valid returns application that can user reach
|
||||
page: { url = /building/create}
|
||||
result: { "application": "4c11f5ef-0bbd-41ac-925e-f79d9aac2b0e" }
|
||||
"""
|
||||
token = request.headers.get(api_config.ACCESS_TOKEN_TAG, None)
|
||||
headers = {
|
||||
"language": language or "",
|
||||
"domain": domain or "",
|
||||
"eys-ext": f"{str(uuid.uuid4())}",
|
||||
"tz": tz or "GMT+3",
|
||||
"token": token,
|
||||
}
|
||||
if not domain or not language:
|
||||
return JSONResponse(
|
||||
content={"error": "EYS_0003"},
|
||||
|
||||
@@ -14,6 +14,10 @@ class RequestVerifyOTP(BaseModel):
|
||||
otp: str
|
||||
|
||||
|
||||
class RequestApplication(BaseModel):
|
||||
page: str # /building/create
|
||||
|
||||
|
||||
class RequestSelectOccupant(BaseModel):
|
||||
|
||||
company_uu_id: str
|
||||
|
||||
Reference in New Issue
Block a user