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)
|
||||
|
||||
app.config.update(
|
||||
SESSION_COOKIE_SAMESITE="None", # necessary for cross-site cookies
|
||||
SESSION_COOKIE_SECURE=False # True in prod (HTTPS)
|
||||
)
|
||||
if env == "production":
|
||||
app.config.update(SESSION_COOKIE_SAMESITE="None", SESSION_COOKIE_SECURE=True)
|
||||
else:
|
||||
app.config.update(SESSION_COOKIE_SAMESITE="Lax", SESSION_COOKIE_SECURE=False)
|
||||
|
||||
env = os.environ.get('FLASK_ENV', 'default')
|
||||
app.config.from_object(config[env])
|
||||
|
||||
Reference in New Issue
Block a user