Update ChallengeType

This commit is contained in:
Chris Eager
2024-03-14 16:16:09 -05:00
committed by GitHub
parent 9f40562b19
commit 231bf91a22
2 changed files with 11 additions and 4 deletions
+10 -3
View File
@@ -46,7 +46,7 @@ type Handler = Readonly<{
}>;
export type ChallengeData = Readonly<{
type: 'recaptcha';
type: 'captcha';
token: string;
captcha: string;
}>;
@@ -259,7 +259,14 @@ export class ChallengeHandler {
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)}`);
}
@@ -384,7 +391,7 @@ export class ChallengeHandler {
try {
await this.sendChallengeResponse({
type: 'recaptcha',
type: 'captcha',
token: lastToken,
captcha,
});
+1 -1
View File
@@ -1211,7 +1211,7 @@ export type ServerKeysType = {
};
export type ChallengeType = {
readonly type: 'recaptcha';
readonly type: 'captcha';
readonly token: string;
readonly captcha: string;
};