Update ChallengeType

This commit is contained in:
Chris Eager 2024-03-14 16:16:09 -05:00 committed by GitHub
parent 9f40562b19
commit 231bf91a22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 4 deletions

View file

@ -46,7 +46,7 @@ type Handler = Readonly<{
}>; }>;
export type ChallengeData = Readonly<{ export type ChallengeData = Readonly<{
type: 'recaptcha'; type: 'captcha';
token: string; token: string;
captcha: string; captcha: string;
}>; }>;
@ -259,7 +259,14 @@ export class ChallengeHandler {
log.info(`${logId}: tracking ${conversationId} with no waitTime`); log.info(`${logId}: tracking ${conversationId} with no waitTime`);
} }
if (data && !data.options?.includes('recaptcha')) { if (
data &&
!(
data.options?.includes('captcha') ||
// 'recaptcha' is deprecated for removal in 90 days
data.options?.includes('recaptcha')
)
) {
log.error(`${logId}: unexpected options ${JSON.stringify(data.options)}`); log.error(`${logId}: unexpected options ${JSON.stringify(data.options)}`);
} }
@ -384,7 +391,7 @@ export class ChallengeHandler {
try { try {
await this.sendChallengeResponse({ await this.sendChallengeResponse({
type: 'recaptcha', type: 'captcha',
token: lastToken, token: lastToken,
captcha, captcha,
}); });

View file

@ -1211,7 +1211,7 @@ export type ServerKeysType = {
}; };
export type ChallengeType = { export type ChallengeType = {
readonly type: 'recaptcha'; readonly type: 'captcha';
readonly token: string; readonly token: string;
readonly captcha: string; readonly captcha: string;
}; };