mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-04 14:49:01 +02:00
Add AbortController polyfill to captcha script (#6555)
GitOrigin-RevId: 3a7e8350b4d6d62583a3cb87378605f13cde3728
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'abort-controller/polyfill'
|
||||
import { postJSON } from '../../infrastructure/fetch-json'
|
||||
|
||||
const grecaptcha = window.grecaptcha
|
||||
@@ -6,13 +7,14 @@ let recaptchaId
|
||||
const recaptchaCallbacks = []
|
||||
|
||||
export async function canSkipCaptcha(email) {
|
||||
const controller = new AbortController()
|
||||
const signal = controller.signal
|
||||
const timer = setTimeout(() => {
|
||||
controller.abort()
|
||||
}, 1000)
|
||||
let timer
|
||||
let canSkip
|
||||
try {
|
||||
const controller = new AbortController()
|
||||
const signal = controller.signal
|
||||
timer = setTimeout(() => {
|
||||
controller.abort()
|
||||
}, 1000)
|
||||
canSkip = await postJSON('/login/can-skip-captcha', {
|
||||
signal,
|
||||
body: { email },
|
||||
|
||||
Reference in New Issue
Block a user