setting, session and profile fix
This commit is contained in:
parent
7d3b6d4e31
commit
e3d8215f2f
1 changed files with 2 additions and 1 deletions
|
|
@ -5,7 +5,6 @@ from __future__ import annotations
|
||||||
from sqlalchemy.ext.asyncio import AsyncSession
|
from sqlalchemy.ext.asyncio import AsyncSession
|
||||||
|
|
||||||
from app.models import Account
|
from app.models import Account
|
||||||
from app.services.org_security import get_or_create_security_settings
|
|
||||||
|
|
||||||
DEFAULT_SESSION_TIMEOUT_MINUTES = 10_080 # 1 week
|
DEFAULT_SESSION_TIMEOUT_MINUTES = 10_080 # 1 week
|
||||||
|
|
||||||
|
|
@ -42,6 +41,8 @@ async def resolve_session_timeout_minutes(
|
||||||
) -> int:
|
) -> int:
|
||||||
timeout = account.session_timeout_minutes or DEFAULT_SESSION_TIMEOUT_MINUTES
|
timeout = account.session_timeout_minutes or DEFAULT_SESSION_TIMEOUT_MINUTES
|
||||||
if account.company_domain:
|
if account.company_domain:
|
||||||
|
from app.services.org_security import get_or_create_security_settings
|
||||||
|
|
||||||
org = await get_or_create_security_settings(session, account.company_domain)
|
org = await get_or_create_security_settings(session, account.company_domain)
|
||||||
timeout = min(timeout, org.session_timeout_minutes)
|
timeout = min(timeout, org.session_timeout_minutes)
|
||||||
return timeout
|
return timeout
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue