web interface uses cookie-based auth

This commit is contained in:
Paul Liverman III 2018-04-24 18:44:50 -07:00
parent 27c6209ae5
commit 384d5ef828
2 changed files with 2 additions and 3 deletions

View File

@ -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);

View File

@ -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", ->