From c8eb0aefe36d9efd873ebb29ca166c286dfe487b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6sche?= Date: Sun, 11 Jan 2026 18:02:24 +0100 Subject: [PATCH] Add Authorization header to modal PDF viewer --- b0esche_cloud/lib/pages/document_viewer.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/b0esche_cloud/lib/pages/document_viewer.dart b/b0esche_cloud/lib/pages/document_viewer.dart index 2535262..e4c64ac 100644 --- a/b0esche_cloud/lib/pages/document_viewer.dart +++ b/b0esche_cloud/lib/pages/document_viewer.dart @@ -180,9 +180,12 @@ class _DocumentViewerModalState extends State { if (state.caps.isPdf) { // Log the URL being used for debugging print('Loading PDF from: ${state.viewUrl}'); - // Token is passed via Authorization header in SessionBloc context + // Pass token via Authorization header - SfPdfViewer supports headers parameter return SfPdfViewer.network( state.viewUrl.toString(), + headers: { + 'Authorization': 'Bearer ${state.token}', + }, onDocumentLoadFailed: (details) { print('PDF load failed: ${details.error}'); print('Description: ${details.description}');