Skip to content

Commit

Permalink
fix: Added a check for if system_settings are defined.
Browse files Browse the repository at this point in the history
  • Loading branch information
osala-eng committed Sep 12, 2023
1 parent 4c6dc38 commit 2f2be4c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/docq/support/auth_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ def _update_auth_expiry(session_id: str) -> None:
def _auto_login_enabled() -> bool:
"""Check if auto login feature is enabled."""
try:
return FeatureType.AUTO_LOGIN.name in get_system_settings(SystemSettingsKey.ENABLED_FEATURES)
system_settings = get_system_settings(SystemSettingsKey.ENABLED_FEATURES)
if system_settings: # Only enable feature when explicitly enabled (dafault to Disabled)
return FeatureType.AUTO_LOGIN.name in system_settings
return False
except Exception as e:
log.error("Failed to check if auto login is enabled: %s", e)
return False
Expand Down

0 comments on commit 2f2be4c

Please sign in to comment.