Conversation
…sent. Also, allow ORCID authentication even if ORCID is currently blank.
Contributor
There was a problem hiding this comment.
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.
For app and sidekiq
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 of changes
Motivation and context
500 error occurred when a user tried to authenticate an ORCID before the config was deployed.
Checklist
to license it to the TeSS codebase under the
BSD license.