🔧 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:
parent
c7b500dd5c
commit
156d8bb089
2 changed files with 3 additions and 14 deletions
|
|
@ -31,18 +31,8 @@ class AuthSettings(BaseSettings):
|
||||||
# If AUTO_LOGIN = True
|
# If AUTO_LOGIN = True
|
||||||
# > The application does not request login and logs in automatically as a super user.
|
# > The application does not request login and logs in automatically as a super user.
|
||||||
AUTO_LOGIN: bool = False
|
AUTO_LOGIN: bool = False
|
||||||
FIRST_SUPERUSER: Optional[str] = Field(
|
FIRST_SUPERUSER: str = "langflow"
|
||||||
"langflow",
|
FIRST_SUPERUSER_PASSWORD: str = "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,
|
|
||||||
)
|
|
||||||
|
|
||||||
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
|
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,8 @@ class SettingsManager(Service):
|
||||||
settings = Settings(**settings_dict)
|
settings = Settings(**settings_dict)
|
||||||
if not settings.CONFIG_DIR:
|
if not settings.CONFIG_DIR:
|
||||||
raise ValueError("CONFIG_DIR must be set in settings")
|
raise ValueError("CONFIG_DIR must be set in settings")
|
||||||
|
|
||||||
auth_settings = AuthSettings(
|
auth_settings = AuthSettings(
|
||||||
CONFIG_DIR=settings.CONFIG_DIR,
|
CONFIG_DIR=settings.CONFIG_DIR,
|
||||||
FIRST_SUPERUSER=None,
|
|
||||||
FIRST_SUPERUSER_PASSWORD=None,
|
|
||||||
)
|
)
|
||||||
return cls(settings, auth_settings)
|
return cls(settings, auth_settings)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue