aboutsummaryrefslogtreecommitdiff
path: root/gn2
diff options
context:
space:
mode:
Diffstat (limited to 'gn2')
-rw-r--r--gn2/wqflask/views.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/gn2/wqflask/views.py b/gn2/wqflask/views.py
index 4b003613..4c7a0ae2 100644
--- a/gn2/wqflask/views.py
+++ b/gn2/wqflask/views.py
@@ -311,6 +311,7 @@ def gnqna():
@app.route("/editor/", methods=["GET"])
+@require_oauth2
def edit_gn_doc_file():
file_path = request.args.get("file-path", "")
response = requests.get(f"http://localhost:8091/edit?file_path={file_path}")
@@ -319,21 +320,22 @@ def edit_gn_doc_file():
@app.route("/editor/settings", methods=["GET"])
+@require_oauth2
def configure_gn_editor():
return render_template("gn_editor_settings.html")
@app.route("/editor/commit", methods=["GET", "POST"])
+@require_oauth2
def commit_gn_doc():
- # TODO add gn-auth requirement for this endpoint
# TODO add env variable for gn-guile web server
if request.method == "GET":
return render_template("gn_editor_commit.html")
results = requests.post("http://localhost:8091/commit", json={
"content": request.form.get("content"),
"filename": request.form.get("file_path"),
- "email": "test@gmail.com",
- "username": "usernm1",
+ "username": session_info()["user"]["name"],
+ "email": session_info()["user"]["email"],
"commit_message": request.form.get("msg"),
"prev_commit": request.form.get("hash")})
data = results.json()