Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f73c2298
Commit
f73c2298
authored
Mar 04, 2022
by
KunQian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add js path entry for JH to replace reCAPTCHA
parent
7f9c8862
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
app/assets/javascripts/captcha/apollo_captcha_link.js
app/assets/javascripts/captcha/apollo_captcha_link.js
+1
-1
app/assets/javascripts/captcha/captcha_modal_axios_interceptor.js
...ts/javascripts/captcha/captcha_modal_axios_interceptor.js
+3
-1
No files found.
app/assets/javascripts/captcha/apollo_captcha_link.js
View file @
f73c2298
...
...
@@ -12,7 +12,7 @@ export const apolloCaptchaLink = new ApolloLink((operation, forward) =>
const
spamLogId
=
captchaError
.
extensions
.
spam_log_id
;
return
new
Observable
((
observer
)
=>
{
import
(
'
~
/captcha/wait_for_captcha_to_be_solved
'
)
import
(
'
jh_else_ce
/captcha/wait_for_captcha_to_be_solved
'
)
.
then
(({
waitForCaptchaToBeSolved
})
=>
waitForCaptchaToBeSolved
(
captchaSiteKey
))
.
then
((
captchaResponse
)
=>
{
// If the captcha was solved correctly, we re-do our action while setting
...
...
app/assets/javascripts/captcha/captcha_modal_axios_interceptor.js
View file @
f73c2298
...
...
@@ -9,7 +9,9 @@ function needsCaptchaResponse(err) {
const
showCaptchaModalAndResubmit
=
async
(
axios
,
data
,
errConfig
)
=>
{
// NOTE: We asynchronously import and unbox the module. Since this is included globally, we don't
// do a regular import because that would increase the size of the webpack bundle.
const
{
waitForCaptchaToBeSolved
}
=
await
import
(
'
~/captcha/wait_for_captcha_to_be_solved
'
);
const
{
waitForCaptchaToBeSolved
}
=
await
import
(
'
jh_else_ce/captcha/wait_for_captcha_to_be_solved
'
);
// show the CAPTCHA modal and wait for it to be solved or closed
const
captchaResponse
=
await
waitForCaptchaToBeSolved
(
data
.
captcha_site_key
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment