mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Add AbortController polyfill to captcha script (#6555)
GitOrigin-RevId: 3a7e8350b4d6d62583a3cb87378605f13cde3728
This commit is contained in:
parent
ae7c7edc69
commit
e73ad85d0e
1 changed files with 7 additions and 5 deletions
|
@ -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 },
|
||||
|
|
Loading…
Reference in a new issue