-
Notifications
You must be signed in to change notification settings - Fork 438
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
add CAPTCHA to request-a-copy form #2712
base: main
Are you sure you want to change the base?
Conversation
TEST
Button error resolved
with some changes
with changes
Updated test cases which are previously fail due to added captcha to request a copy
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.
Thank you @GauravD2t! This PR seems good as is. I will test it as soon as I can.
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.
@GauravD2t : I tested this today and I'm not able to get it to work as expected. Here's the issues I'm seeing:
- First, I cannot get Catcha to load on the Request a Copy form unless I also enable it on the registration form.
- In other works I have to set BOTH of these to true:
registration.verification.enabled = true requestcopy.verification.enabled = true
- If I only set "requestcopy" to true, then it doesn't work. So, this will not work:
registration.verification.enabled = false requestcopy.verification.enabled = true
- I think the problem here is that you didn't add the
requestcopy.verification.enabled
setting on the backend to list of properties shared with the UI like this: https://github.com/DSpace/DSpace/blob/main/dspace/config/modules/rest.cfg#L45 - I think you also didn't update the
google-recaptcha.service.ts
to recognize therequestcopy.verification.enabled
setting... so it is ignoring that setting.
- Possibly related to the above issue, the "Request a copy" form no longer works when Captcha is disabled (
requestcopy.verification.enabled=false
) on backend. With that setting in place, it's impossible to submit the "Request a Copy" form as the "Request copy" button is always disabled, even when required fields are filled out. Here's a screenshot:
- Finally, even with Captcha enabled, I cannot get the Request a Copy form to submit properly. Every time I submit the form, I get a 403 Forbidden error that says:
403 Forbidden "Invalid captcha token"
:org.dspace.eperson.InvalidReCaptchaException: Response contains invalid characters at org.dspace.app.rest.repository.RequestItemRepository.createAndReturn(RequestItemRepository.java:118)
- I can verify that Captcha works fine for me on the registration page. I ONLY see this error on the Request a Copy form.
I also have some inline code suggestions below.
src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.html
Show resolved
Hide resolved
src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.spec.ts
Show resolved
Hide resolved
src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts
Outdated
Show resolved
Hide resolved
src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts
Outdated
Show resolved
Hide resolved
src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts
Outdated
Show resolved
Hide resolved
src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts
Outdated
Show resolved
Hide resolved
revert file
Hi @GauravD2t, |
@GauravD2t : Unfortunately this feature missed our feature merger deadlines for 8.0 (as feedback was not addressed in time). It will need to be rescheduled for 9.0. |
Hi @GauravD2t, |
References
Description
add a GOOGLE CAPTCHA to the request-a-copy form.
Instructions for Reviewers
Please add a more detailed description of the changes made by your PR. At a minimum, providing a bulleted list of changes in your PR is helpful to reviewers.
List of changes in this PR:
Include guidance for how to test or review your PR. This may include: steps to reproduce a bug, screenshots or description of a new feature, or reasons behind specific changes.
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
yarn lint
yarn check-circ-deps
)package.json
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.