Treat every ORCID conflict as orcid_in_use - #308
Merged
Conversation
Deploying nemar-website with
|
| Latest commit: |
a3bdeed
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://327eef89.nemar-website.pages.dev |
| Branch Preview URL: | https://feature-issue-305-orcid-in-u.nemar-website.pages.dev |
Add a shared identity-errors mapping so orcid_in_use and the deprecated
orcid_already_linked alias render one sentence, and email_in_use /
github_in_use / orcid_linked_other get consistent copy too. Wired into
the ORCID finalize (complete.astro), login, and settings pages, which
previously either lacked orcid_in_use entirely or hardcoded their own
divergent wording.
complete.astro's browser script reads its lookup key straight from a
fetch() JSON response, so it now calls the exported
identityConflictMessage() helper (Object.hasOwn-guarded internally)
instead of indexing the shared map directly, which would have resolved
a prototype key ("constructor", "toString") to a function rather than
undefined.
neuromechanist
force-pushed
the
feature/issue-305-orcid-in-use
branch
from
September 6, 2026 03:08
a3bdeed to
00fa38e
Compare
This was referenced Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #305.
nemar-cli #1254 (ADR 0043) makes an ORCID iD back at most one live NEMAR account and returns a typed
codeon every refusal.orcid_in_useand the deprecatedorcid_already_linkedalias mean the same thing to a user (which D1 constraint noticed is not something anyone can act on), but the website only ever switched onorcid_already_linked, and nothing mappedorcid_in_useat all — so the new race-path refusals from nemar-cli #1254 would have fallen through to a generic "something went wrong" message.src/lib/identity-errors.ts: one sharedIDENTITY_CONFLICT_MESSAGESmap keyed onorcid_in_use(withorcid_already_linkedfolded in as an alias to the exact same sentence), plusemail_in_useandgithub_in_use, each mirroring the wording of the backend'sshared/contract/identity.tsIDENTITY_CONFLICT_MESSAGES.orcid_linked_otheris kept as its own distinct message (it's the settings link/relink refusal — a different account already holds the finished iD — not a sign-up conflict).src/pages/auth/orcid/complete.astro(sign-up finalize) — previously had noorcid_in_useentry at all, and its own divergentemail_in_use/orcid_already_linkedcopy.src/pages/login.astro— previously had neitherorcid_in_usenororcid_already_linked.src/pages/settings.astro— previously had neitherorcid_in_usenororcid_already_linked.orcid_already_linkedno longer appears as a branch/case anywhere insrc/ortest/— it exists only as the alias key (plus explanatory comments) insideidentity-errors.ts.Testing
bun run test— 1916 tests pass, including newsrc/lib/identity-errors.test.ts(alias resolves to the identical string asorcid_in_use;orcid_linked_otherstays distinct; unknown codes degrade toundefined;Object.hasOwn-based lookup is prototype-safe againstconstructor/__proto__/etc.) and newtest/identity-conflict-pages.test.ts(source-level guards, followingtest/signin-notice.test.ts's pattern, that all three pages import and spread the shared mapping and that none of them hardcode a competingorcid_already_linked/orcid_linked_other/email_in_usestring).bun run typecheck— 0 errors (pre-existing unrelated hints only).bunx biome check --writeon all changed files — clean.NEMAR_SKIP_OG_GENERATE=1 bun run build— succeeds.