Skip to content

feat: add sign-up and ORCID-at-sign-up use cases - #502

Open
ChengShi-1 wants to merge 2 commits into
developfrom
builtin-user-signup-and-orcid
Open

ChengShi-1 wants to merge 2 commits into
developfrom
builtin-user-signup-and-orcid

Conversation

@ChengShi-1

@ChengShi-1 ChengShi-1 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Adds use cases for the new sign-up API, so the modern UI (and other clients) can let new users create a builtin account and optionally connect their ORCID iD while signing up.

  • signUp calls POST /users/signup without authentication and creates a builtin user.
  • getOrcidSignUpAuthorizationUrl calls GET /users/signup/orcid/authorize and returns the ORCID URL to send the user to.
  • connectOrcidForSignUp calls POST /users/signup/orcid with the code and state ORCID returns. It gives back the ORCID iD, the details to pre-fill the form with, and the orcidToken to include in signUp.
  • AuthenticatedUser has an optional authenticatedOrcid.
  • ReadError and WriteError now expose the HTTP statusCode and, when the API returns them, per-field fieldErrors. That lets a form show validation errors next to the right fields.
  • ApiRepository.doPost takes an optional authRequired argument (default true), so a request can be sent without the configured credentials.

This replaces 3f94643b, which was pushed to develop by mistake and is being reverted in #501.

Which issue(s) this PR closes:

Related Dataverse PRs:

Special notes for your reviewer:

Suggestions on how to test this:

  1. Unit tests: npm run test:unit.
  2. Integration tests (need a Dataverse image built from Add a sign-up API for the modern UI, with optional ORCID iD dataverse#12858): set DATAVERSE_IMAGE_TAG in test/environment/.env to that image, then run npm run test:integration.
  3. The ORCID use cases need an ORCID sandbox client, so the integration tests only cover the cases that don't reach ORCID, such as ORCID not being configured.

Is there a release notes or changelog update needed for this change?:

Yes, added under "Unreleased" in CHANGELOG.md.

Additional documentation:

The three new use cases are documented in docs/useCases.md.

Adds SignUp, GetOrcidSignUpAuthorizationUrl and ConnectOrcidForSignUp for
POST /users/signup, GET /users/signup/orcid/authorize and
POST /users/signup/orcid, which are called without authentication.
AuthenticatedUser gains authenticatedOrcid.

ReadError and WriteError now carry the HTTP statusCode and the server's
fieldErrors, so clients can show validation errors next to form fields.
@ChengShi-1 ChengShi-1 self-assigned this Oct 27, 2026
@ChengShi-1 ChengShi-1 linked an issue Nov 3, 2026 that may be closed by this pull request
@ChengShi-1 ChengShi-1 added this to the 0.5.0 milestone Nov 3, 2026
The sign-up endpoints aren't in the unstable image yet. Switch back to
docker.io/unstable once #12858 is merged.
@ChengShi-1
ChengShi-1 marked this pull request as ready for review November 3, 2026 16:18
Copilot AI balanced review requested due to automatic review settings November 3, 2026 16:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@ChengShi-1 ChengShi-1 moved this to Ready for Review ⏩ in IQSS Dataverse Project Nov 3, 2026
@ChengShi-1 ChengShi-1 removed their assignment Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Ready for Review ⏩

Development

Successfully merging this pull request may close these issues.

Sign Up Use Cases

2 participants