Skip to content

Commit 29a6642

Browse files
authored
Merge pull request #6145 from Countly/ar2rsawseen/master
[email-reports] fix exposing auth token
2 parents 6e95089 + 6d45c19 commit 29a6642

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

plugins/reports/frontend/public/javascripts/countly.views.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@
9797
});
9898
break;
9999
case "preview-comment":
100-
var url = '/i/reports/preview?auth_token=' + countlyGlobal.auth_token + '&args=' + JSON.stringify({_id: scope.row._id}) + "&app_id=" + countlyCommon.ACTIVE_APP_ID;
101-
window.open(url, "_blank");
100+
document.forms.previewemailform.action = '/i/reports/preview?args=' + JSON.stringify({_id: scope.row._id}) + "&app_id=" + countlyCommon.ACTIVE_APP_ID;
101+
document.forms.previewemailform.querySelectorAll('input[type=hidden]')[0].value = countlyGlobal.auth_token;
102+
document.forms.previewemailform.submit();
102103
break;
103104
default:
104105
return;

plugins/reports/frontend/public/templates/vue-main.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@
9494
<el-dropdown-item icon="el-icon-position" command="send-comment">
9595
Send Now
9696
</el-dropdown-item>
97+
<form name="previewemailform" method="post" target="_blank">
98+
<input type="hidden" name="auth_token">
99+
</form>
97100
<el-dropdown-item icon="el-icon-chat-dot-square" command="preview-comment">
98101
Preview
99102
</el-dropdown-item>

0 commit comments

Comments
 (0)