Update app.py
Browse files
app.py
CHANGED
|
@@ -74,6 +74,11 @@ if not (CONTRACT_ADDRESS.startswith("0x") and len(CONTRACT_ADDRESS) == 42):
|
|
| 74 |
config_valid = False
|
| 75 |
config_errors.append("Invalid Smart Contract Address.")
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
if not config_valid:
|
| 78 |
st.error("⚠️ **Configuration Errors:**")
|
| 79 |
for error in config_errors:
|
|
@@ -261,13 +266,21 @@ passwords = [user.password for user in users]
|
|
| 261 |
# Initialize Authenticator
|
| 262 |
if users:
|
| 263 |
authenticator = stauth.Authenticate(
|
| 264 |
-
names,
|
| 265 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 266 |
)
|
| 267 |
else:
|
| 268 |
authenticator = stauth.Authenticate(
|
| 269 |
-
[],
|
| 270 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 271 |
)
|
| 272 |
|
| 273 |
name, authentication_status, username = authenticator.login('Login', 'main')
|
|
|
|
| 74 |
config_valid = False
|
| 75 |
config_errors.append("Invalid Smart Contract Address.")
|
| 76 |
|
| 77 |
+
if db_type == "PostgreSQL":
|
| 78 |
+
if not all([pg_host, pg_port, pg_user, pg_password, pg_db]):
|
| 79 |
+
config_valid = False
|
| 80 |
+
config_errors.append("All PostgreSQL configuration fields must be filled.")
|
| 81 |
+
|
| 82 |
if not config_valid:
|
| 83 |
st.error("⚠️ **Configuration Errors:**")
|
| 84 |
for error in config_errors:
|
|
|
|
| 266 |
# Initialize Authenticator
|
| 267 |
if users:
|
| 268 |
authenticator = stauth.Authenticate(
|
| 269 |
+
names,
|
| 270 |
+
usernames,
|
| 271 |
+
passwords,
|
| 272 |
+
'citibank_demo_business_inc_ai_crypto', # cookie_name
|
| 273 |
+
'abcdef', # key
|
| 274 |
+
1 # cookie_expiry_days
|
| 275 |
)
|
| 276 |
else:
|
| 277 |
authenticator = stauth.Authenticate(
|
| 278 |
+
[],
|
| 279 |
+
[],
|
| 280 |
+
[],
|
| 281 |
+
'citibank_demo_business_inc_ai_crypto', # cookie_name
|
| 282 |
+
'abcdef', # key
|
| 283 |
+
1 # cookie_expiry_days
|
| 284 |
)
|
| 285 |
|
| 286 |
name, authentication_status, username = authenticator.login('Login', 'main')
|