-
Notifications
You must be signed in to change notification settings - Fork 1k
Captcha token retry #5845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Captcha token retry #5845
Conversation
...t/StripePaymentSheet/Source/PaymentSheet/ConfirmationChallenge/PassiveCaptchaChallenge.swift
Outdated
Show resolved
Hide resolved
...tripePaymentSheetTests/PaymentSheet/ConfirmationChallenge/PassiveCaptchaChallengeTests.swift
Outdated
Show resolved
Hide resolved
...tripePaymentSheetTests/PaymentSheet/ConfirmationChallenge/PassiveCaptchaChallengeTests.swift
Outdated
Show resolved
Hide resolved
...t/StripePaymentSheet/Source/PaymentSheet/ConfirmationChallenge/PassiveCaptchaChallenge.swift
Outdated
Show resolved
Hide resolved
wooj-stripe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall
...tripePaymentSheetTests/PaymentSheet/ConfirmationChallenge/PassiveCaptchaChallengeTests.swift
Outdated
Show resolved
Hide resolved
...t/StripePaymentSheet/Source/PaymentSheet/ConfirmationChallenge/PassiveCaptchaChallenge.swift
Outdated
Show resolved
Hide resolved
| func fetchTokensWithTimeout() async -> ChallengeTokens { | ||
| let startTime = Date() | ||
| let isReady = await passiveCaptchaChallenge?.hasFetchedToken ?? false | ||
| let isReady = await passiveCaptchaChallenge?.isTokenReady ?? false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IsTokenReady seems to be used for analytics, and we are changing the underlying definition of it -- I'm guessing we're prepared to update any dashboards/queries to filter out older clients with the older definition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HCaptcha on MPE is not public yet, so this isn't affecting anything.
Summary
The captcha token can expire. On the back end, its max_age is set to 1800 seconds, or 30 minutes. We treat the token as expired at 29 minutes to prevent the case where a user confirms at, say, 1799 seconds, and the back end sees a token that has just expired. After expiration, when the user confirms, we fetch a new token.
Motivation
HCaptcha project
Testing
Added test
Changelog
N/A