From 384d5ef8283c6d60bb1661441d1e85497212b8c4 Mon Sep 17 00:00:00 2001 From: Paul Liverman III Date: Tue, 24 Apr 2018 18:44:50 -0700 Subject: [PATCH] web interface uses cookie-based auth --- static/index.js | 4 ++-- views/index/logged_in.moon | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/static/index.js b/static/index.js index ef005f1..d6f8224 100644 --- a/static/index.js +++ b/static/index.js @@ -20,7 +20,7 @@ function check(id) { uri = "/v1/do"; // TODO hide it! } - $.post(uri, {api_key: API_KEY, id: id}, function(data) { + $.post(uri, {id: id}, function(data) { checkbox.prop("checked", data.task.done); }) .fail(function(request) { @@ -41,7 +41,7 @@ function get_template(id) { function new_task() { let input = $("#new-task-input"); let template; - $.post("/v1/new", {api_key: API_KEY, content: input.val()}, function(data) { + $.post("/v1/new", {content: input.val()}, function(data) { template = get_template("#task-template"); let input = $("input", template); input.prop("id", "task-" + data.task.id); diff --git a/views/index/logged_in.moon b/views/index/logged_in.moon index 4cd6f82..3d57e91 100644 --- a/views/index/logged_in.moon +++ b/views/index/logged_in.moon @@ -23,7 +23,6 @@ class LoggedIn extends Widget div class: "column column-offset-20 column-20", -> button class: "delete", onclick: "delete_item(this);", "x" - script -> raw "var API_KEY = '#{@keys[1].key}';" -- TODO will be removed soon script src: "/static/index.js" script id: "task-template", type: "text/x-custom-template", ->