MVP ready to test

This commit is contained in:
Timo Knuth
2025-10-28 17:20:37 +01:00
parent 91b78cb284
commit 2f0208ebf9
48 changed files with 6258 additions and 110 deletions

View File

@@ -3,6 +3,7 @@
import React, { useState } from 'react';
import { Button } from '@/components/ui/Button';
import { showToast } from '@/components/ui/Toast';
import { useCsrf } from '@/hooks/useCsrf';
interface ChangePasswordModalProps {
isOpen: boolean;
@@ -15,6 +16,7 @@ export default function ChangePasswordModal({
onClose,
onSuccess,
}: ChangePasswordModalProps) {
const { fetchWithCsrf } = useCsrf();
const [currentPassword, setCurrentPassword] = useState('');
const [newPassword, setNewPassword] = useState('');
const [confirmPassword, setConfirmPassword] = useState('');
@@ -47,9 +49,8 @@ export default function ChangePasswordModal({
setLoading(true);
try {
const response = await fetch('/api/user/password', {
const response = await fetchWithCsrf('/api/user/password', {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
currentPassword,
newPassword,