🔧 chore(auth.py): remove unnecessary comments and fields in AuthSettings class

🔧 chore(manager.py): remove unnecessary arguments in AuthSettings instantiation
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-08-31 11:43:41 -03:00
commit 156d8bb089
2 changed files with 3 additions and 14 deletions

View file

@ -31,18 +31,8 @@ class AuthSettings(BaseSettings):
# If AUTO_LOGIN = True
# > The application does not request login and logs in automatically as a super user.
AUTO_LOGIN: bool = False
FIRST_SUPERUSER: Optional[str] = Field(
"langflow",
description="First super user to be created if AUTO_LOGIN is True.",
env="LANGFLOW_FIRST_SUPERUSER",
allow_mutation=False,
)
FIRST_SUPERUSER_PASSWORD: Optional[str] = Field(
"langflow",
description="First super user password to be created if AUTO_LOGIN is True.",
env="LANGFLOW_FIRST_SUPERUSER_PASSWORD",
allow_mutation=False,
)
FIRST_SUPERUSER: str = "langflow"
FIRST_SUPERUSER_PASSWORD: str = "langflow"
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")

View file

@ -37,9 +37,8 @@ class SettingsManager(Service):
settings = Settings(**settings_dict)
if not settings.CONFIG_DIR:
raise ValueError("CONFIG_DIR must be set in settings")
auth_settings = AuthSettings(
CONFIG_DIR=settings.CONFIG_DIR,
FIRST_SUPERUSER=None,
FIRST_SUPERUSER_PASSWORD=None,
)
return cls(settings, auth_settings)