ensure https in backend
This commit is contained in:
8
main.py
8
main.py
@@ -15,10 +15,10 @@ def create_app():
|
|||||||
]
|
]
|
||||||
CORS(app, supports_credentials=True, origins=origins)
|
CORS(app, supports_credentials=True, origins=origins)
|
||||||
|
|
||||||
app.config.update(
|
if env == "production":
|
||||||
SESSION_COOKIE_SAMESITE="None", # necessary for cross-site cookies
|
app.config.update(SESSION_COOKIE_SAMESITE="None", SESSION_COOKIE_SECURE=True)
|
||||||
SESSION_COOKIE_SECURE=False # True in prod (HTTPS)
|
else:
|
||||||
)
|
app.config.update(SESSION_COOKIE_SAMESITE="Lax", SESSION_COOKIE_SECURE=False)
|
||||||
|
|
||||||
env = os.environ.get('FLASK_ENV', 'default')
|
env = os.environ.get('FLASK_ENV', 'default')
|
||||||
app.config.from_object(config[env])
|
app.config.from_object(config[env])
|
||||||
|
|||||||
Reference in New Issue
Block a user