mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-19 20:24:32 +02:00
Update JWT expiry time config (#3717)
* update redis configs * update comment
This commit is contained in:
@@ -55,6 +55,7 @@ from onyx.auth.invited_users import get_invited_users
|
|||||||
from onyx.auth.schemas import UserCreate
|
from onyx.auth.schemas import UserCreate
|
||||||
from onyx.auth.schemas import UserRole
|
from onyx.auth.schemas import UserRole
|
||||||
from onyx.auth.schemas import UserUpdate
|
from onyx.auth.schemas import UserUpdate
|
||||||
|
from onyx.configs.app_configs import AUTH_COOKIE_EXPIRE_TIME_SECONDS
|
||||||
from onyx.configs.app_configs import AUTH_TYPE
|
from onyx.configs.app_configs import AUTH_TYPE
|
||||||
from onyx.configs.app_configs import DISABLE_AUTH
|
from onyx.configs.app_configs import DISABLE_AUTH
|
||||||
from onyx.configs.app_configs import EMAIL_CONFIGURED
|
from onyx.configs.app_configs import EMAIL_CONFIGURED
|
||||||
@@ -209,6 +210,7 @@ def verify_email_domain(email: str) -> None:
|
|||||||
class UserManager(UUIDIDMixin, BaseUserManager[User, uuid.UUID]):
|
class UserManager(UUIDIDMixin, BaseUserManager[User, uuid.UUID]):
|
||||||
reset_password_token_secret = USER_AUTH_SECRET
|
reset_password_token_secret = USER_AUTH_SECRET
|
||||||
verification_token_secret = USER_AUTH_SECRET
|
verification_token_secret = USER_AUTH_SECRET
|
||||||
|
verification_token_lifetime_seconds = AUTH_COOKIE_EXPIRE_TIME_SECONDS
|
||||||
|
|
||||||
user_db: SQLAlchemyUserDatabase[User, uuid.UUID]
|
user_db: SQLAlchemyUserDatabase[User, uuid.UUID]
|
||||||
|
|
||||||
|
@@ -92,6 +92,12 @@ OAUTH_CLIENT_SECRET = (
|
|||||||
|
|
||||||
USER_AUTH_SECRET = os.environ.get("USER_AUTH_SECRET", "")
|
USER_AUTH_SECRET = os.environ.get("USER_AUTH_SECRET", "")
|
||||||
|
|
||||||
|
# Duration (in seconds) for which the FastAPI Users JWT token remains valid in the user's browser.
|
||||||
|
# By default, this is set to match the Redis expiry time for consistency.
|
||||||
|
AUTH_COOKIE_EXPIRE_TIME_SECONDS = int(
|
||||||
|
os.environ.get("AUTH_COOKIE_EXPIRE_TIME_SECONDS") or 86400 * 7
|
||||||
|
) # 7 days
|
||||||
|
|
||||||
# for basic auth
|
# for basic auth
|
||||||
REQUIRE_EMAIL_VERIFICATION = (
|
REQUIRE_EMAIL_VERIFICATION = (
|
||||||
os.environ.get("REQUIRE_EMAIL_VERIFICATION", "").lower() == "true"
|
os.environ.get("REQUIRE_EMAIL_VERIFICATION", "").lower() == "true"
|
||||||
|
Reference in New Issue
Block a user