mirror of
https://github.com/status-im/spiff-arena.git
synced 2025-02-27 00:40:37 +00:00
this somewhat works and sets cookies w/ burnettk
This commit is contained in:
parent
b9612f2d30
commit
0974cda185
@ -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)
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,6 +42,12 @@ export default function ProcessGroupList() {
|
|||||||
path: `/process-models?per_page=1000&recursive=true&include_parent_groups=true`,
|
path: `/process-models?per_page=1000&recursive=true&include_parent_groups=true`,
|
||||||
successCallback: processResultForProcessModels,
|
successCallback: processResultForProcessModels,
|
||||||
});
|
});
|
||||||
|
HttpService.makeCallToBackend({
|
||||||
|
path: `/status`,
|
||||||
|
successCallback: (result: any) => {
|
||||||
|
console.log(result);
|
||||||
|
},
|
||||||
|
});
|
||||||
}, [searchParams]);
|
}, [searchParams]);
|
||||||
|
|
||||||
const processModelSearchArea = () => {
|
const processModelSearchArea = () => {
|
||||||
@ -63,8 +69,10 @@ export default function ProcessGroupList() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (processModelAvailableItems) {
|
if (processModelAvailableItems) {
|
||||||
|
console.log('document.cookie', document.cookie);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
{document.cookie}
|
||||||
<ProcessBreadcrumb hotCrumbs={[['Process Groups']]} />
|
<ProcessBreadcrumb hotCrumbs={[['Process Groups']]} />
|
||||||
<Can I="POST" a={targetUris.processGroupListPath} ability={ability}>
|
<Can I="POST" a={targetUris.processGroupListPath} ability={ability}>
|
||||||
<Button kind="secondary" href="/admin/process-groups/new">
|
<Button kind="secondary" href="/admin/process-groups/new">
|
||||||
|
@ -64,6 +64,7 @@ backendCallProps) => {
|
|||||||
Object.assign(httpArgs, {
|
Object.assign(httpArgs, {
|
||||||
headers: new Headers(headers as any),
|
headers: new Headers(headers as any),
|
||||||
method: httpMethod,
|
method: httpMethod,
|
||||||
|
credentials: 'include',
|
||||||
});
|
});
|
||||||
|
|
||||||
const updatedPath = path.replace(/^\/v1\.0/, '');
|
const updatedPath = path.replace(/^\/v1\.0/, '');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user