@ -39,7 +39,7 @@
<script type="text/javascript">
$(function () {
function render(output, input) {
$.post('/api/markdown', { s: input.val() }, function (s) {
$.post('/api/markdown', { s: input.val(), _csrf: document.head.getAttribute('data-csrf-token') }, function (s) {
// console.log(s);
output.html(s);
});
@ -58,7 +58,8 @@ function login() {
type: 'POST',
data: {
"username": $("#username").val(),
"password": password
"password": password,
"_csrf": document.head.getAttribute('data-csrf-token')
},
async: true,
success: function(data) {
@ -71,7 +71,7 @@
@ -62,7 +62,8 @@ function submit() {
username: $("#username").val(),
password: password,
email: $("#email").val(),
prevUrl: <%- JSON.stringify(req.query.url || '/') %>
prevUrl: <%- JSON.stringify(req.query.url || '/') %>,
_csrf: document.head.getAttribute('data-csrf-token')
error_code = data.error_code;