Update app.py
Browse files
app.py
CHANGED
|
@@ -69,6 +69,18 @@ def update_details():
|
|
| 69 |
user_data.append(['','','','',''])
|
| 70 |
user_inst.append(['','','',''])
|
| 71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
@app.post("/update/system/userInfo")
|
| 73 |
async def update_Details(info: UpdateSystemRequest, token: str = Depends(verify_access_token)):
|
| 74 |
i = Tokens.index(token)
|
|
@@ -156,15 +168,6 @@ def currentTime():
|
|
| 156 |
current_time = datetime.now(ist_offset)
|
| 157 |
return current_time.strftime("%I:%M %p")
|
| 158 |
|
| 159 |
-
def verify_access_token(auth: HTTPAuthorizationCredentials = Depends(security)):
|
| 160 |
-
token = auth.credentials
|
| 161 |
-
if token not in Tokens:
|
| 162 |
-
raise HTTPException(
|
| 163 |
-
status_code=401,
|
| 164 |
-
detail="Invalid or expired session token. Please login again."
|
| 165 |
-
)
|
| 166 |
-
return token
|
| 167 |
-
|
| 168 |
|
| 169 |
@app.post("/new_conversation")
|
| 170 |
async def handleNewConv(new_conv: NewConv, token: str = Depends(verify_access_token)):
|
|
|
|
| 69 |
user_data.append(['','','','',''])
|
| 70 |
user_inst.append(['','','',''])
|
| 71 |
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
def verify_access_token(auth: HTTPAuthorizationCredentials = Depends(security)):
|
| 75 |
+
token = auth.credentials
|
| 76 |
+
if token not in Tokens:
|
| 77 |
+
raise HTTPException(
|
| 78 |
+
status_code=401,
|
| 79 |
+
detail="Invalid or expired session token. Please login again."
|
| 80 |
+
)
|
| 81 |
+
return token
|
| 82 |
+
|
| 83 |
+
|
| 84 |
@app.post("/update/system/userInfo")
|
| 85 |
async def update_Details(info: UpdateSystemRequest, token: str = Depends(verify_access_token)):
|
| 86 |
i = Tokens.index(token)
|
|
|
|
| 168 |
current_time = datetime.now(ist_offset)
|
| 169 |
return current_time.strftime("%I:%M %p")
|
| 170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
|
| 172 |
@app.post("/new_conversation")
|
| 173 |
async def handleNewConv(new_conv: NewConv, token: str = Depends(verify_access_token)):
|