Commit graph

16 commits

Author SHA1 Message Date
Chris
d32b5943d1
fix(search): Handle touch events to prevent input blur on mobile when saving views (#1039)
On mobile devices, clicking "Save as Smart View" button caused the search
input to lose focus, triggering the onBlur handler that closes the entire
search menu. The existing onMouseDown preventDefault() only worked for
mouse events, not touch events on mobile.

Added onTouchStart handler alongside onMouseDown to properly prevent
input blur on mobile devices when interacting with the search menu.

Fixes #994
2026-04-17 18:43:30 +03:00
Chris
6c9902b584
fix: add CSRF token support to frontend requests (#1025)
This commit implements CSRF token support for all session-based API
requests to fix the "CSRF token missing" and "CSRF token mismatch" errors
introduced after CSRF protection was added in commit 62c4cc84.

Changes:
- Created csrfService.ts utility for fetching and caching CSRF tokens
- Added getPostHeadersWithCsrf() helper to authUtils for async token injection
- Updated all service files (*Service.ts) to include CSRF tokens in POST/PUT/PATCH/DELETE requests
- Updated components with inline fetch calls to use getCsrfToken()
- Fixed CSRF middleware to use single lusca instance instead of creating new instances per request
- Improved generateToken() to use req.csrfToken() when available
- Added CalDAV path exemption to CSRF protection

Technical details:
- CSRF tokens are fetched from /api/csrf-token endpoint
- Tokens are cached and reused across requests to avoid unnecessary fetches
- Tokens are included in x-csrf-token header for state-changing requests
- Public endpoints (login, register) remain exempt from CSRF protection
- Bearer token authentication remains exempt from CSRF protection

Files modified:
- Backend: app.js, middleware/csrf.js
- Frontend: 13 service files, 8 component files
- New file: frontend/utils/csrfService.ts

This ensures all session-based requests properly include CSRF tokens while
maintaining support for API token authentication.
2026-04-14 15:06:56 +03:00
Chris
a80e9b5aba
Fix redirect after task deletion to return to originating view (#887) 2026-03-01 16:07:02 +02:00
Chris
b0b613f7bd
Reorder elements (#687)
* Reorder elements

* Enhance global search
2025-12-09 10:51:51 +02:00
Chris
08c23d2f96
Fix today pagination (#596)
* fixup! Feat notifications (#594)

* Add pagination to today

* Add defer to search

* fixup! Add defer to search

* Add preuploaded banners

* fixup! Add preuploaded banners

* Fix project banner

* fixup! Fix project banner

* fixup! fixup! Fix project banner
2025-11-26 23:00:50 +02:00
Chris
49d22789e7
Feat add recurring search (#579)
* Add recurring tasks in search

* fixup! Add recurring tasks in search

* fixup! fixup! Add recurring tasks in search
2025-11-18 20:35:50 +02:00
Chris
2a1769bd72
Fix smart view pagination (#557)
* Add pagination to smart views

* fixup! Add pagination to smart views

* fixup! fixup! Add pagination to smart views

* fixup! fixup! fixup! Add pagination to smart views
2025-11-17 18:39:14 +02:00
Chris
673a6a56ee
Fix static base path (#549) 2025-11-16 22:43:06 +02:00
Chris Veleris
63dfb51aaf Fix search links 2025-10-29 23:16:32 +02:00
antanst
f860fdfe3e More stable tests by using proper data-* attrs 2025-10-25 09:25:27 +03:00
antanst
35afeb9a72 E2E test hardening.
- Use test specific db, not development
- Clean up DB after each test run.
2025-10-25 09:25:27 +03:00
Chris
48ee54a12f
Fix universal search (#445)
* Fix tags not included in views

* fixup! Fix tags not included in views

* Show toaster when creating view

* Add more translations

* Fix test issues
2025-10-23 21:43:42 +03:00
Chris Veleris
c6407570c7 Fix search collapse on mobile 2025-10-23 21:43:17 +03:00
David Leibovych
2761afb190
fix: keyboard should be hidden always on input blur (#446) 2025-10-23 21:31:49 +03:00
David Leibovych
f4769b62ef
feat: focus shows the modal, blur hides the modal on mobile (#442) 2025-10-23 11:50:27 +03:00
Chris
02b493d61f
Universal search (#412)
* Global search scaffold

* Add search preview text

* Add generic fallback for preview text in search

* fixup! Add generic fallback for preview text in search

* Add more tweaks

* fixup! Add more tweaks

* Fix an issue with criteria

* fixup! Fix an issue with criteria

* fixup! fixup! Fix an issue with criteria

* fixup! fixup! fixup! Fix an issue with criteria

* Fix an issue with priority filter

* fixup! Fix an issue with priority filter

* Add sortable pins

* fixup! Add sortable pins

* Make options collapsed by default

* Tweak UI

* Add tests

* Add translations

* Add more translations

* fixup! Add more translations

* Add minor tweaks
2025-10-22 22:00:45 +03:00