Skip to content

Commit 3e43884

Browse files
[codex] Handle missing CLI auth code tokens (#710)
Co-authored-by: James Grugett <jahooma@gmail.com>
1 parent ae4138a commit 3e43884

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

freebuff/web/src/app/onboard/page.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,27 @@ const Onboard = async ({ searchParams }: PageProps) => {
126126
)
127127
}
128128

129+
if (authCodeResolution.status === 'missing') {
130+
logger.info(
131+
{
132+
authCodeLength: authCode.length,
133+
authCodeTrimmedLength: authCode.trim().length,
134+
authCodeHashPrefix: getCliAuthCodeHashPrefix(authCode),
135+
isOpaqueAuthCodeToken: isOpaqueCliAuthCodeToken(authCode),
136+
userId: user.id,
137+
},
138+
'Missing Freebuff CLI auth code token',
139+
)
140+
141+
return (
142+
<StatusCard
143+
title="Login link expired"
144+
description="This browser login link is no longer active."
145+
message="Return to your terminal and restart Freebuff to generate a new login link."
146+
/>
147+
)
148+
}
149+
129150
const {
130151
authCode: resolvedAuthCode,
131152
resolvedOpaqueToken,

web/src/app/onboard/page.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ const Onboard = async ({ searchParams }: PageProps) => {
6969
)
7070
}
7171

72+
if (authCodeResolution.status === 'missing') {
73+
return (
74+
<CardWithBeams
75+
title="This login link has expired"
76+
description="Return to your terminal and restart Codebuff to generate a new login link."
77+
content={<p>You can close this browser window.</p>}
78+
/>
79+
)
80+
}
81+
7282
const { authCode: resolvedAuthCode } = authCodeResolution
7383
const { fingerprintId, expiresAt, receivedHash } =
7484
parseAuthCode(resolvedAuthCode)

0 commit comments

Comments
 (0)