Akash4911 commited on
Commit
43f3ef4
·
1 Parent(s): eaeeb48

Legacy text routes now fallback to guest access when auth token is missing or invalid

Browse files
backend/app/routers/legacy_router.py CHANGED
@@ -18,7 +18,15 @@ async def get_optional_user(authorization: str = Header(None)):
18
  "subscription_tier": "free",
19
  "is_offline": True,
20
  }
21
- return await get_current_user(authorization)
 
 
 
 
 
 
 
 
22
 
23
 
24
  @router.post("/analyze/text")
 
18
  "subscription_tier": "free",
19
  "is_offline": True,
20
  }
21
+ try:
22
+ return await get_current_user(authorization)
23
+ except Exception:
24
+ return {
25
+ "email": "guest@fakeshield.local",
26
+ "full_name": "Guest User",
27
+ "subscription_tier": "free",
28
+ "is_offline": True,
29
+ }
30
 
31
 
32
  @router.post("/analyze/text")