Skip to content

Commit

Permalink
Add some missing csrf tokens that broke project hiding and icon uploads
Browse files Browse the repository at this point in the history
Signed-off-by: Walker Crouse <walkercrouse@hotmail.com>
  • Loading branch information
windy1 committed Jan 7, 2017
1 parent 1837b0c commit 09e02cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "ore"

version := "1.1.10"
version := "1.1.11"

lazy val `ore` = (project in file(".")).enablePlugins(PlayScala)

Expand Down
1 change: 1 addition & 0 deletions public/javascripts/hideProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ $(function() {
$.ajax({
type: 'post',
url: '/' + project + '/visible/' + !visible,
data: { csrfToken: csrf },
fail: function () {
spinner.addClass(iconClass).removeClass('fa-spinner fa-spin');
},
Expand Down
5 changes: 4 additions & 1 deletion public/javascripts/iconUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@ $(function() {
var btn = form.find('.btn-upload');
var url = '/' + PROJECT_OWNER + '/' + PROJECT_SLUG + '/icon';
var preview = form.find('.user-avatar');
var input = form.find('input');
var input = form.find('input[type="file"]');

function updateButton() {
btn.prop('disabled', input[0].files.length == 0);
}

input.on('change', function() { updateButton(); });

var formData = new FormData(form[0]);
formData.append('csrfToken', csrf);

// Upload button
btn.click(function(e) {
e.preventDefault();
Expand Down

0 comments on commit 09e02cd

Please sign in to comment.