fix: treat 401/403 from exchange as invalid-ticket (single-use UX)
This commit is contained in:
@@ -236,8 +236,9 @@ async function redeemTicket(ticket) {
|
|||||||
} finally {
|
} finally {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
}
|
}
|
||||||
if (resp.status === 404) {
|
if (resp.status === 404 || resp.status === 401 || resp.status === 403) {
|
||||||
// Ticket unknown or already redeemed (single-use)
|
// Ticket unknown / already redeemed (single-use) or bad server-to-server
|
||||||
|
// credentials — indistinguishable from the client's perspective.
|
||||||
throw Object.assign(new Error('Invalid or expired ticket'), { status: 401 });
|
throw Object.assign(new Error('Invalid or expired ticket'), { status: 401 });
|
||||||
}
|
}
|
||||||
if (!resp.ok) {
|
if (!resp.ok) {
|
||||||
|
|||||||
Reference in New Issue
Block a user