fix(today-settings): add missing CSRF token to today settings PUT request (#1044)

TodaySettingsDropdown was the only settings component that omitted the
x-csrf-token header, causing PUT /api/profile/today-settings to return
500 for all session-authenticated users.

Adds integration tests for the today-settings endpoint.
This commit is contained in:
Graham Rogers 2026-04-20 11:05:03 +01:00 committed by GitHub
parent a21e643842
commit b9eaedc468
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 60 additions and 0 deletions

View file

@ -1,4 +1,5 @@
import React, { useState, useEffect, useRef } from 'react';
import { getCsrfToken } from '../../utils/csrfService';
import { useTranslation } from 'react-i18next';
import {
ChartBarIcon,
@ -86,6 +87,7 @@ const TodaySettingsDropdown: React.FC<TodaySettingsDropdownProps> = ({
credentials: 'include',
headers: {
'Content-Type': 'application/json',
'x-csrf-token': await getCsrfToken(),
},
body: JSON.stringify(settingsToSave),
});