feat: add cookie domain setting

This commit is contained in:
swve 2023-05-27 22:08:21 +02:00
parent 2414f47dc1
commit 078ff189ac
4 changed files with 77 additions and 82 deletions

View file

@ -1,3 +1,5 @@
from webbrowser import get
from config.config import get_learnhouse_config
from pydantic import BaseModel
from fastapi import Depends, HTTPException, status
from fastapi.security import OAuth2PasswordBearer
@ -19,7 +21,7 @@ class Settings(BaseModel):
authjwt_access_token_expires = False # (pre-alpha only) # TODO: set to 1 hour
authjwt_cookie_samesite = "lax"
authjwt_cookie_secure = True
authjwt_cookie_domain = ".localhost"
authjwt_cookie_domain = get_learnhouse_config().hosting_config.cookie_config.domain
@AuthJWT.load_config # type: ignore