Skip to content

Commit fb0b2f0

Browse files
committed
change login request
1 parent 96acd15 commit fb0b2f0

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

login.js

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,6 @@ function setCookies(token) {
55
}
66

77
document.getElementById('login-btn').addEventListener('click', function() {
8-
let res = login();
9-
if(res){
10-
setCookies(res);
11-
window.location.replace("/soundboxBooking.html")
12-
}else{
13-
window.alert("network error");
14-
}
15-
});
16-
17-
async function login(){
188
let url = "https://soundbox.v1an.xyz/login";
19-
try {
20-
const response = await fetch(url, {
21-
method: 'GET',
22-
credentials: 'include',
23-
});
24-
const result = await response.json();
25-
return result.toString();
26-
} catch (e) {
27-
console.error("Error on getting:", e);
28-
return null;
29-
}
30-
}
9+
window.location.replace(url);
10+
});

0 commit comments

Comments
 (0)