From 0406ec4da63ccbf8c4bcdfa3e6e9a5bc1716c182 Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Tue, 15 Oct 2024 05:14:11 -0400 Subject: [PATCH 1/2] #339: check for authentication failures --- segments/bff.segment.json | 4 ---- src/webui/features/ErrorHandler.tsx | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/segments/bff.segment.json b/segments/bff.segment.json index 3cdfdfc0..ea3af0e6 100644 --- a/segments/bff.segment.json +++ b/segments/bff.segment.json @@ -12,9 +12,6 @@ "./domain/creator/register/feature": { "default": { "access": "private" }}, "./domain/creator/updateFullName/feature": { "default": { "access": "public" }}, "./domain/creator/updateNickname/feature": { "default": { "access": "public" }}, - "./domain/creator/updateFollowerCount/feature": { "default": { "access": "private" }}, - "./domain/creator/updateFollowingCount/feature": { "default": { "access": "private" }}, - "./domain/creator/updatePostCount/feature": { "default": { "access": "private" }}, "./domain/image/create/feature": { "default": { "access": "private" } }, "./domain/image/download/feature": { "default": { "access": "private" } }, @@ -40,7 +37,6 @@ "./domain/reaction/getByPostAggregated/feature": { "default": { "access": "public" } }, "./domain/reaction/remove/feature": { "default": { "access": "public" } }, "./domain/reaction/toggleRating/feature": { "default": { "access": "public" } }, - "./domain/reaction/updateRatingCount/feature": { "default": { "access": "private" }}, "./domain/relation/aggregate/feature": { "default": { "access": "private" } }, "./domain/relation/exploreAggregated/feature": { "default": { "access": "public" } }, diff --git a/src/webui/features/ErrorHandler.tsx b/src/webui/features/ErrorHandler.tsx index 7bb72ca1..22938f13 100644 --- a/src/webui/features/ErrorHandler.tsx +++ b/src/webui/features/ErrorHandler.tsx @@ -9,7 +9,10 @@ type Props = { export default function Feature({ error }: Props) { - const isUnauthorized = error?.constructor?.name === 'Unauthorized'; + const isUnauthorized = error?.constructor?.name === 'Unauthorized' + || error === 'Invalid authorization type' + || error === 'Invalid authorization key' + || error === 'Session expired'; const ErrorPanel = Oops... From fc31208952f5d38c6cf3dfe875644f189b3758be Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Tue, 15 Oct 2024 05:27:54 -0400 Subject: [PATCH 2/2] #339: supress eslint warning --- src/webui/hooks/usePagination.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/webui/hooks/usePagination.ts b/src/webui/hooks/usePagination.ts index 2bbeecfa..f15104c8 100644 --- a/src/webui/hooks/usePagination.ts +++ b/src/webui/hooks/usePagination.ts @@ -60,6 +60,7 @@ export function usePagination(getData: GetData, limit: number, deps: Depen resetData(); loadData(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(resetData, [resetData, limit, ...deps]);