Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 8a3f046

Browse files
committed
add authorization header
1 parent ad3566a commit 8a3f046

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/web/WEB-INF/includes/jq_1_11_1.jsp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<script type="text/javascript" src="/scripts/bootstrap.min.js"></script>
1414
<script type="text/javascript" src="/scripts/magicsuggest.js"></script>
1515
<script type="text/javascript">
16+
var jwtCookieName = "@ApplicationServer.JWT_V3_COOKIE_KEY@";
1617
var jQuery_1_11_1 = $.noConflict(true);
1718
var member_api_url = "@memberSearchApiUrl@";
1819
var group_member_api_url = "@groupMemberSearchApiUrl@";

src/web/scripts/editCockpitProject.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ $(document).ready(function (e) {
310310
dataType: 'json',
311311
contentType: 'application/json; charset=utf-8',
312312
async: false,
313+
beforeSend: function (xhr) {
314+
xhr.setRequestHeader("Authorization", "Bearer " + $.cookie(jwtCookieName));
315+
},
313316
success: function (result) {
314317
if (typeof(result['result']) !== 'undefined') {
315318
$.each(result['result']['content'], function (index, member) {

src/web/scripts/launch/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,9 @@ $(document).ready(function() {
299299
dataType: 'json',
300300
contentType: 'application/json; charset=utf-8',
301301
async: false,
302+
beforeSend: function (xhr) {
303+
xhr.setRequestHeader("Authorization", "Bearer " + $.cookie(jwtCookieName));
304+
},
302305
success: function (jsonResult) {
303306
if (jQuery_1_11_1("#groups").magicSuggest().getValue().length > 0){
304307
handleJsonResult(jsonResult, function(result){

0 commit comments

Comments
 (0)