fix: CSRF regression — grace period for old sessions, GET check-port/refresh-ip, Peers.jsx native fetch tokens
- check_csrf() now issues a token for sessions that predate CSRF (existing logins) instead of blocking them - /api/wireguard/check-port and /api/wireguard/refresh-ip accept GET so native fetch calls bypass the token requirement - WireGuard.jsx: changed three native fetch POST → GET for the above endpoints - Peers.jsx: add X-CSRF-Token header to three native fetch mutation calls (calendar collection, peer PUT, clear-reinstall) - api.js: export getCsrfToken() so non-Axios callers can read the current token Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,10 @@ export function setCsrfToken(token) {
|
||||
_csrfToken = token;
|
||||
}
|
||||
|
||||
export function getCsrfToken() {
|
||||
return _csrfToken;
|
||||
}
|
||||
|
||||
// Create axios instance with base configuration
|
||||
const api = axios.create({
|
||||
baseURL: import.meta.env.VITE_API_URL || '',
|
||||
|
||||
Reference in New Issue
Block a user