Skip to content
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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

GauravD2t
Copy link
Contributor

@GauravD2t GauravD2t commented Dec 14, 2023

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:

  • First, ...
  • Second, ...

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!

  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

For Test added consoles
Button error resolved
with some changes
with changes
Copy link
Contributor

@paulo-graca paulo-graca left a 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.

Copy link
Member

@tdonohue tdonohue left a 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:

  1. 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 the requestcopy.verification.enabled setting... so it is ignoring that setting.
  2. 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:
    Cannot-submit-form
  3. 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.

Copy link

github-actions bot commented Mar 4, 2024

Hi @GauravD2t,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@tdonohue
Copy link
Member

tdonohue commented Mar 4, 2024

@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.

Copy link

github-actions bot commented Mar 8, 2024

Hi @GauravD2t,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ❓ Stalled/On Hold
Development

Successfully merging this pull request may close these issues.

add CAPTCHA to request-a-copy form
3 participants