this somewhat works and sets cookies w/ burnettk

This commit is contained in:
jasquat 2023-01-11 15:57:01 -05:00
parent 4b5d2d6112
commit aa626d7432
3 changed files with 8 additions and 4 deletions

View File

@ -115,7 +115,7 @@ def create_app() -> flask.app.Flask:
r"^https?:\/\/%s(.*)" % o.replace(".", r"\.") r"^https?:\/\/%s(.*)" % o.replace(".", r"\.")
for o in app.config["CORS_ALLOW_ORIGINS"] for o in app.config["CORS_ALLOW_ORIGINS"]
] ]
CORS(app, origins=origins_re, max_age=3600) CORS(app, origins=origins_re, max_age=3600, supports_credentials=True)
connexion_app.add_api("api.yml", base_path=V1_API_PATH_PREFIX) connexion_app.add_api("api.yml", base_path=V1_API_PATH_PREFIX)

View File

@ -10,4 +10,7 @@ from spiffworkflow_backend.models.process_instance import ProcessInstanceModel
def status() -> flask.wrappers.Response: def status() -> flask.wrappers.Response:
"""Status.""" """Status."""
ProcessInstanceModel.query.filter().first() ProcessInstanceModel.query.filter().first()
return Response(json.dumps({"ok": True}), status=200, mimetype="application/json") response = Response(json.dumps({"ok": True}), status=200, mimetype="application/json")
response.set_cookie('TEST_COOKIE', 'HEY')
response.set_cookie('TEST_COOKIE', 'HEY', domain='spiff.localdev')
return response

View File

@ -89,9 +89,10 @@ def process_group_list(
"pages": pages, "pages": pages,
}, },
} }
response = make_response(jsonify(response_json), 200) # response = make_response(jsonify(response_json), 200)
response = Response(json.dumps(response_json), status=200, mimetype="application/json")
current_app.logger.info("SETTING COOKIE") current_app.logger.info("SETTING COOKIE")
# response.set_cookie('TEST_COOKIE', 'HEY', domain=".spiff.dev", secure=False, httponly=True) response.set_cookie('TEST_COOKIE', 'HEY1', domain='spiff.localdev')
return response return response