app-MAIL-temp/app/proton/utils.py
Carlos Quintana 58990ec762
Hide proton integration behind cookie (#1092)
* Hide proton integration behind cookie

* Make cookie name configurable via config
2022-06-15 15:42:41 +02:00

12 lines
346 B
Python

from app.config import CONNECT_WITH_PROTON, CONNECT_WITH_PROTON_COOKIE_NAME
from flask import request
def is_connect_with_proton_enabled() -> bool:
if CONNECT_WITH_PROTON:
return True
if CONNECT_WITH_PROTON_COOKIE_NAME and request.cookies.get(
CONNECT_WITH_PROTON_COOKIE_NAME
):
return True
return False