Skip to content

Commit

Permalink
token header
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurian committed Nov 12, 2017
1 parent 878a8f9 commit 3b85e4d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions converter.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ <h3 id="script-title" class="entry-title">hypertranscript appears here ⤵</h3>

var API = 'https://' + prefix + 'api.' + domain + '/v1';

$.ajaxPrefilter( function( options, originalOptions, jqXHR ) {
if (options.url.indexOf(API) == 0) {
if (window.localStorage.getItem('token')) {
jqXHR.setRequestHeader('Authorization', 'Bearer ' + window.localStorage.getItem('token'));
}
}
});

var mediaObject;
var mediaID = purl(window.top.document.location.href).param('m');
var transcriptID = purl(window.top.document.location.href).param('t');
Expand Down

0 comments on commit 3b85e4d

Please sign in to comment.