Skip to content

Check ORCID authentication enabled#1237

Merged
fbacall merged 4 commits intomasterfrom
orcid-auth-fixes
Feb 18, 2026
Merged

Check ORCID authentication enabled#1237
fbacall merged 4 commits intomasterfrom
orcid-auth-fixes

Conversation

@fbacall
Copy link
Member

@fbacall fbacall commented Feb 17, 2026

Summary of changes

  • Hide "Authenticate your ORCID" option (and disable actions) if ORCID credentials are not set in config.
  • Show "Link your ORCID" button if ORCID in profile is currently blank.

Motivation and context

500 error occurred when a user tried to authenticate an ORCID before the config was deployed.

Checklist

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree
    to license it to the TeSS codebase under the
    BSD license.

…sent.

Also, allow ORCID authentication even if ORCID is currently blank.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds a feature guard to prevent 500 errors when ORCID authentication credentials are not configured. It hides the ORCID authentication button when credentials are missing and provides different button text ("Link your ORCID" vs "Authenticate your ORCID") based on whether the user currently has an ORCID in their profile.

Changes:

  • Added orcid_authentication_enabled? configuration method to check if ORCID credentials are present
  • Added before_action guard in OrcidController to prevent access when feature is disabled
  • Updated user profile view to conditionally show ORCID authentication button based on configuration
  • Added comprehensive test coverage for the new feature guard

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
config/application.rb Added orcid_authentication_enabled? method to check if ORCID credentials are configured
app/controllers/orcid_controller.rb Added orcid_auth_enabled before_action to raise RoutingError when feature is disabled
app/views/users/show.html.erb Updated conditional logic to check feature availability and show appropriate button text
config/locales/en.yml Added new translation key orcid.link for "Link your ORCID" button text
test/controllers/users_controller_test.rb Added tests for button visibility with different ORCID states and feature disabled scenarios
test/controllers/orcid_controller_test.rb Added tests to verify controller actions raise errors when feature is disabled

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

fbacall and others added 3 commits February 17, 2026 16:28
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@fbacall fbacall merged commit 41c5503 into master Feb 18, 2026
11 checks passed
@fbacall fbacall deleted the orcid-auth-fixes branch February 18, 2026 10:11
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

Comments