Fix JS fetch credentials and CSV export from web UI
This commit is contained in:
@@ -57,7 +57,7 @@ document.getElementById('login-form').addEventListener('submit', async (e) => {
|
||||
form.append('username', document.getElementById('username').value);
|
||||
form.append('password', document.getElementById('password').value);
|
||||
try {
|
||||
const res = await fetch('/api/auth/login', { method: 'POST', body: form });
|
||||
const res = await fetch('/api/auth/login', { method: 'POST', body: form, credentials: 'include' });
|
||||
if (res.ok) {
|
||||
window.location.href = '/';
|
||||
} else {
|
||||
@@ -79,6 +79,7 @@ document.getElementById('register-form').addEventListener('submit', async (e) =>
|
||||
const res = await fetch('/api/auth/register', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
credentials: 'include',
|
||||
body: JSON.stringify({
|
||||
username: document.getElementById('reg-username').value,
|
||||
password: document.getElementById('reg-password').value,
|
||||
|
||||
Reference in New Issue
Block a user