Skip to content

Commit

Permalink
Do not show option to connect accounts in acocunt settings if not con…
Browse files Browse the repository at this point in the history
…figured in server (closes #811) (#856)
  • Loading branch information
ml-evs committed Aug 22, 2024
1 parent 556c3cd commit bc5399f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions webapp/src/components/EditAccountSettingsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</a>

<a
v-else
v-else-if="showGitHub"
type="button"
class="dropdown-item btn login btn-link btn-default"
aria-label="Login via GitHub"
Expand All @@ -86,7 +86,7 @@
{{ user.identities.find((identity) => identity.identity_type === "orcid").name }}
</a>
<a
v-else
v-else-if="showORCID"
type="button"
class="dropdown-item btn login btn-link btn-default"
aria-label="Connect ORCID account"
Expand Down Expand Up @@ -157,6 +157,12 @@ export default {
};
},
computed: {
showGitHub() {
return this.$store.state.serverInfo?.features?.auth_mechanisms?.github ?? false;
},
showORCID() {
return this.$store.state.serverInfo?.features?.auth_mechanisms?.orcid ?? false;
},
displayNameValidationMessage() {
if (!this.user.display_name || /^\s*$/.test(this.user.display_name)) {
return "Name is required.";
Expand Down

0 comments on commit bc5399f

Please sign in to comment.