🔧 chore(auth.py): add API_V1_STR constant to improve code readability and maintainability

🐛 fix(auth.py): update tokenUrl in oauth2_scheme to use API_V1_STR constant for consistency
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-08-25 10:17:25 -03:00
commit 7e3d329df9

View file

@ -18,6 +18,7 @@ class AuthSettings(BaseSettings):
str
] = "b82818e0ad4ff76615c5721ee21004b07d84cd9b87ba4d9cb42374da134b841a"
API_KEY_ALGORITHM: str = "HS256"
API_V1_STR: str = "/api/v1"
# If AUTO_LOGIN = True
# > The application does not request login and logs in automatically as a super user.
@ -26,7 +27,7 @@ class AuthSettings(BaseSettings):
FIRST_SUPERUSER_PASSWORD: str = "langflow"
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="login")
oauth2_scheme = OAuth2PasswordBearer(tokenUrl=f"{API_V1_STR}/login")
class Config:
validate_assignment = True