File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,7 +159,11 @@ const performHandshake = async (): Promise<CachedToken | undefined> => {
159159 if ( assertResponse . ok ) {
160160 return parseTokenResponse ( await assertResponse . json ( ) )
161161 }
162- // Server rejected the assertion: discard the key and re-attest.
162+ // Server rejected the assertion: the enrolled key is no longer trusted,
163+ // so any previously-minted token is suspect too. Drop it now so gated
164+ // callers do not keep sending a token the server already rejects while
165+ // re-enrollment is in progress; discard the key and re-attest.
166+ cachedToken = undefined
163167 console . warn (
164168 `[attestation] assertion rejected (${ assertResponse . status } ); re-attesting`
165169 )
@@ -191,6 +195,9 @@ const performHandshake = async (): Promise<CachedToken | undefined> => {
191195 if ( assertResponse . ok ) {
192196 return parseTokenResponse ( await assertResponse . json ( ) )
193197 }
198+ // Server rejected the assertion: drop the now-suspect cached token (see
199+ // the iOS branch above) before discarding the key and re-attesting.
200+ cachedToken = undefined
194201 console . warn (
195202 `[attestation] assertion rejected (${ assertResponse . status } ); re-attesting`
196203 )
You can’t perform that action at this time.
0 commit comments