From c324dcbe7c372d6a0da935244908b23ecefe762d Mon Sep 17 00:00:00 2001 From: Abhinav Date: Sat, 26 Feb 2022 15:16:07 +0530 Subject: [PATCH] only reset password on token expiring error --- src/pages/shared-albums/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/shared-albums/index.tsx b/src/pages/shared-albums/index.tsx index bcb47d4e8..a11347df3 100644 --- a/src/pages/shared-albums/index.tsx +++ b/src/pages/shared-albums/index.tsx @@ -165,7 +165,10 @@ export default function PublicCollectionGallery() { setPublicFiles ); } catch (e) { - passwordJWTToken.current = null; + const parsedError = parseSharingErrorCodes(e); + if (parsedError.message === CustomError.TOKEN_EXPIRED) { + passwordJWTToken.current = null; + } } } if (isPasswordProtected && !passwordJWTToken.current) {