adjusted to more secure nginx config
Some checks failed
PHPUnit / test (push) Has been cancelled

This commit is contained in:
2026-06-16 10:49:20 +02:00
parent 3d738bb14e
commit 0add7c62e9
5 changed files with 39 additions and 14 deletions

View File

@ -1,6 +1,6 @@
import { navigate } from '../router.js';
import { isLoggedIn, showToast } from '../app.js';
import { apiGet, invalidateSessionCheck } from '../api.js';
import { apiGet, invalidateSessionCheck, apiUrl } from '../api.js';
const WEBSITE_ROLES = ['admin', 'supervisor'];
@ -103,7 +103,7 @@ export async function loginPage() {
setFormBusy('loginForm', true, 'Signing in…');
try {
const res = await fetch('../api/auth/login', {
const res = await fetch(apiUrl('auth/login'), {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@ -176,7 +176,7 @@ export async function loginPage() {
if (pendingTempToken) {
headers['Authorization'] = `Bearer ${pendingTempToken}`;
}
const res = await fetch('../api/auth/change-password', {
const res = await fetch(apiUrl('auth/change-password'), {
method: 'POST',
headers,
body: JSON.stringify({ username: pendingUsername, old_password: oldPw, new_password: newPw }),