Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -266,7 +266,7 @@ async def generate(
|
|
| 266 |
id_token = authorization.split("Bearer ")[1]
|
| 267 |
try:
|
| 268 |
# Verify token securely to prevent API abuse
|
| 269 |
-
decoded_token =
|
| 270 |
user_id = decoded_token['uid']
|
| 271 |
except Exception as e:
|
| 272 |
raise HTTPException(status_code=401, detail=f"Unauthorized: Invalid token ({str(e)})")
|
|
|
|
| 266 |
id_token = authorization.split("Bearer ")[1]
|
| 267 |
try:
|
| 268 |
# Verify token securely to prevent API abuse
|
| 269 |
+
decoded_token = firebase_auth.verify_id_token(id_token)
|
| 270 |
user_id = decoded_token['uid']
|
| 271 |
except Exception as e:
|
| 272 |
raise HTTPException(status_code=401, detail=f"Unauthorized: Invalid token ({str(e)})")
|