Skip to content

Commit 3ab2990

Browse files
committed
fix: address PR review on token handling and retry messaging
1 parent 50f2eb1 commit 3ab2990

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

frontend/src/components/AppPanels.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export function CreateFeedPanel({
198198
<input
199199
id="access-token"
200200
name="access-token"
201-
type="text"
201+
type="password"
202202
class="input input--mono input--minimal"
203203
aria-label="Access token"
204204
placeholder="Paste access token"

frontend/src/hooks/useAccessToken.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,15 @@ export function useAccessToken() {
6363

6464
try {
6565
const token = storage.getItem(ACCESS_TOKEN_KEY)?.trim() ?? '';
66-
const legacyToken =
67-
token || typeof window === 'undefined'
68-
? ''
69-
: (window.sessionStorage?.getItem(ACCESS_TOKEN_KEY)?.trim() ?? '');
66+
let legacyToken = '';
67+
if (!token && typeof window !== 'undefined') {
68+
try {
69+
legacyToken = window.sessionStorage?.getItem(ACCESS_TOKEN_KEY)?.trim() ?? '';
70+
} catch {
71+
// Treat restricted sessionStorage access as no legacy token.
72+
legacyToken = '';
73+
}
74+
}
7075

7176
if (!token && legacyToken) {
7277
storage.setItem(ACCESS_TOKEN_KEY, legacyToken);

frontend/src/hooks/useFeedConversion.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ function buildRetryFailureMessage(
270270
return `Tried ${requestedStrategy} first, then ${fallbackStrategy}. ${secondMessage}`;
271271
}
272272

273-
return `Tried ${requestedStrategy} first, then ${fallbackStrategy}. ${secondMessage}`;
273+
return `Tried ${requestedStrategy} first, then ${fallbackStrategy}. First attempt failed with: ${firstMessage}. Second attempt failed with: ${secondMessage}`;
274274
}
275275

276276
function buildConversionError(message: string, metadata: Partial<ConversionError>): ConversionError {

0 commit comments

Comments
 (0)