Spaces:
Sleeping
Sleeping
github-actions[bot] commited on
Commit ·
e216e82
1
Parent(s): 621eb30
Automated deployment from GitHub Actions: 72aace6ce454ca43dc3a58cb01d3c0dc72cdf9f5
Browse files- src/dependencies.py +11 -0
src/dependencies.py
CHANGED
|
@@ -130,6 +130,17 @@ async def get_current_user(
|
|
| 130 |
"""
|
| 131 |
token = credentials.credentials
|
| 132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
credentials_exception = HTTPException(
|
| 134 |
status_code=status.HTTP_401_UNAUTHORIZED,
|
| 135 |
detail="Invalid or expired authentication token",
|
|
|
|
| 130 |
"""
|
| 131 |
token = credentials.credentials
|
| 132 |
|
| 133 |
+
if settings.DISABLE_AUTH:
|
| 134 |
+
return CurrentUser(
|
| 135 |
+
sub="demo-bypass-user",
|
| 136 |
+
email="admin@tradeflow.ai",
|
| 137 |
+
full_name="Demo User",
|
| 138 |
+
roles=["admin", "operator", "supervisor", "sme"],
|
| 139 |
+
tier="enterprise",
|
| 140 |
+
company_id="demo-bypass-user",
|
| 141 |
+
raw_token=token,
|
| 142 |
+
)
|
| 143 |
+
|
| 144 |
credentials_exception = HTTPException(
|
| 145 |
status_code=status.HTTP_401_UNAUTHORIZED,
|
| 146 |
detail="Invalid or expired authentication token",
|