Skip to content

Commit f834e3b

Browse files
committed
js: fix 401 when using basic auth by passing creds
1 parent a673fe6 commit f834e3b

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11

22
dist/
3+
*.exe

compactbro.exe

-12.5 MB
Binary file not shown.

static/js.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ function backgroundUnread(){
144144
if (document.getElementById('msgTrigger')){
145145
return;
146146
}
147-
fetch(baseURL+'/checkunread/', {method: 'HEAD'}).then(r =>{
147+
fetch(baseURL+'/checkunread/', {method: 'HEAD', credentials: 'include'}).then(r =>{
148148
if (r.status === 200){
149149
const mail = document.getElementById('mail');
150150
const mailcl = mail.classList;
@@ -156,12 +156,13 @@ function backgroundUnread(){
156156
}
157157

158158
function get(url){
159-
return fetch(baseURL+url, {method: 'GET'});
159+
return fetch(baseURL+url, {method: 'GET', credentials: 'include'});
160160
}
161161

162162
function pst(url,json){
163163
return fetch(baseURL+url, {
164164
method: 'POST',
165+
credentials: 'include',
165166
headers: {
166167
'Accept': 'application/json',
167168
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)