Skip to content

PM-6066: Require login to sign terms - #7287

Open
jmgasper wants to merge 1 commit into
developfrom
PM-6066
Open

jmgasper wants to merge 1 commit into
developfrom
PM-6066

Conversation

@jmgasper

Copy link
Copy Markdown
Collaborator

What was broken

Anonymous visitors opening /challenges/terms/detail/:termId could use acceptance controls and receive a success message after an unauthorized request.

Root cause

The Community App terms detail container did not check authentication before rendering electronic acceptance or mounting DocuSign. Its success dialog also treated an agreement error as a completed acceptance. The Terms API already requires authentication for signing.

What was changed

  • Require a nonempty member auth token for electronic acceptance and DocuSign.
  • Keep electronic terms publicly readable and offer the existing login flow.
  • Show success only for an authenticated visitor with no agreement failure.
  • Document the container's authentication behavior.

Files changed:

  • src/shared/containers/terms-detail/index.jsx
  • __tests__/shared/containers/terms-detail/index.jsx

Any added/updated tests

Added nine regression tests covering missing tokens, the login action, authenticated acceptance, unauthorized responses, already agreed terms, DocuSign, and logout.

Validation under Node 10.24.1 after nvm use:

  • npm run lint passed, including JavaScript and SCSS.
  • npm run build passed, including the retired CMS target check.
  • npm run jest -- --runTestsByPath __tests__/shared/containers/terms-detail/index.jsx --coverage=false passed all nine regression tests.
  • npm test passed: 169 suites, 462 tests, and 141 snapshots. The project skipped four suites and 23 tests.
  • git diff --check passed.

Live visual verification was blocked: no browser is connected, and the existing local dependency installation lacks sharp/build/Release/sharp.node, preventing npm start. Component regression tests verify public reading and authenticated-only signing behavior for the direct-link flow shown in the attachment.

Jira: https://topcoder.atlassian.net/browse/PM-6066

What was broken
Anonymous visitors to a direct terms link could use acceptance controls and
receive a success message after an unauthorized request.

Root cause
The Community App terms detail container did not check authentication before
rendering electronic acceptance or mounting DocuSign. Its success dialog also
treated an agreement error as a completed acceptance.

What was changed
Require a nonempty member auth token for electronic acceptance and DocuSign.
Keep electronic terms publicly readable and offer the existing login flow.
Show success only for an authenticated visitor with no agreement failure.
Document the container's authentication behavior.

Any added/updated tests
Add nine regression tests for missing tokens, the login action, authenticated
acceptance, unauthorized responses, already agreed terms, DocuSign, and logout.
npm run lint and npm run build passed. npm test passed with 462 tests and
141 snapshots; 23 existing tests were skipped.
Live visual verification was blocked by an unavailable browser and the existing
missing sharp native module when starting the local server.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant