fix rate_limit tests and add prod_mode to env
This commit is contained in:
@@ -20,6 +20,8 @@ class Env(Base):
|
||||
REDIS_PORT:int
|
||||
REDIS_HOST:str
|
||||
|
||||
PROD_MODE:bool
|
||||
|
||||
model_config=SettingsConfigDict(env_file="configs/.env", extra=None)
|
||||
|
||||
env_settings=Env() # type: ignore[call-arg]
|
||||
@@ -38,7 +38,7 @@ async def get_access_token(request: Request,
|
||||
key="refresh_token",
|
||||
value=refresh_token,
|
||||
httponly=True,
|
||||
secure=True,
|
||||
secure=env_settings.PROD_MODE,
|
||||
samesite="strict",
|
||||
max_age=env_settings.REFRESH_TOKEN_EXPIRE_DAYS * 24 * 60 * 60
|
||||
)
|
||||
@@ -57,7 +57,7 @@ async def get_refresh_token(request:Request,
|
||||
key="refresh_token",
|
||||
value=refresh_token,
|
||||
httponly=True,
|
||||
secure=True,
|
||||
secure=env_settings.PROD_MODE,
|
||||
samesite="strict",
|
||||
max_age=env_settings.REFRESH_TOKEN_EXPIRE_DAYS * 24 * 60 * 60
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user