Skip to content

Commit

Permalink
Set the headers correctly (#5)
Browse files Browse the repository at this point in the history
* Set the headers correctly

* Set initial token value & correct method

* Remove debug statement
  • Loading branch information
martijnjanssen authored and Sille Kamoen committed Sep 21, 2017
1 parent b3c5392 commit bd392e4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lancie-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@
}
</style>
<iron-form is="iron-form" id="form"
headers="[[_getHeaders(token, contentType)]]"
on-iron-form-response="handleResponse"
on-iron-form-error="handleResponse">

<form
method="[[method]]"
enctype="[[contentType]]"
headers="[[_getHeaders(token)]]"
action="/api/v1/[[refurl]]"
on-keydown="submitOnEnter">
<slot></slot>
Expand Down Expand Up @@ -56,7 +55,11 @@
value: false,
},
refurl: String,
token: String,
token: {
type: String,
value: '',
notify: true,
}
},

/* STATIC CALL */
Expand Down Expand Up @@ -113,9 +116,10 @@
this.fire('enter');
},

_getHeaders: function(token) {
_getHeaders: function(token, contentType) {
return {
'X-Auth-Token': token,
'Content-Type': contentType,
};
},

Expand Down

0 comments on commit bd392e4

Please sign in to comment.