Skip to content

Commit 1f77d7f

Browse files
improve register form external login cilogon/custos styling
1 parent 0635ad6 commit 1f77d7f

2 files changed

Lines changed: 24 additions & 11 deletions

File tree

client/src/components/Login/RegisterForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ async function submit() {
112112
<BCardBody>
113113
Create a Galaxy account using an institutional account (e.g.:Google/JHU). This will
114114
redirect you to your institutional login through Custos.
115-
<ExternalLogin />
115+
<ExternalLogin class="mt-2" />
116116
</BCardBody>
117117
</BCollapse>
118118
</span>

client/src/components/User/ExternalIdentities/ExternalLogin.vue

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import axios, { type AxiosError } from "axios";
3-
import { BAlert, BButton, BForm, BFormCheckbox, BFormGroup } from "bootstrap-vue";
3+
import { BAlert, BButton, BButtonGroup, BForm, BFormCheckbox, BFormGroup } from "bootstrap-vue";
44
import { computed, onMounted, ref } from "vue";
55
import Multiselect from "vue-multiselect";
66
@@ -45,7 +45,7 @@ const messageVariant = ref<string | null>(null);
4545
const cILogonIdps = ref<Idp[]>([]);
4646
const selected = ref<Idp | null>(null);
4747
const rememberIdp = ref(false);
48-
const cilogonOrCustos = ref<string | null>(null);
48+
const cilogonOrCustos = ref<"cilogon" | "custos" | null>(null);
4949
const toggleCilogon = ref(false);
5050
5151
const oIDCIdps = computed<OIDCConfig>(() => (isConfigLoaded.value ? config.value.oidc : {}));
@@ -77,8 +77,10 @@ onMounted(async () => {
7777
}
7878
});
7979
80-
function toggleCILogon(idp: string) {
81-
toggleCilogon.value = !toggleCilogon.value;
80+
function toggleCILogon(idp: "cilogon" | "custos") {
81+
if (cilogonOrCustos.value === idp || cilogonOrCustos.value === null) {
82+
toggleCilogon.value = !toggleCilogon.value;
83+
}
8284
cilogonOrCustos.value = toggleCilogon.value ? idp : null;
8385
}
8486
@@ -227,13 +229,23 @@ function getIdpPreference() {
227229
</div>
228230

229231
<div v-else>
230-
<BButton v-if="cILogonEnabled" @click="toggleCILogon('cilogon')">
231-
Sign in with Institutional Credentials*
232-
</BButton>
232+
<BButtonGroup class="w-100">
233+
<BButton
234+
v-if="cILogonEnabled"
235+
:pressed="cilogonOrCustos === 'cilogon'"
236+
@click="toggleCILogon('cilogon')">
237+
Sign in with Institutional Credentials*
238+
</BButton>
233239

234-
<BButton v-if="custosEnabled" @click="toggleCILogon('custos')">Sign in with Custos*</BButton>
240+
<BButton
241+
v-if="custosEnabled"
242+
:pressed="cilogonOrCustos === 'custos'"
243+
@click="toggleCILogon('custos')">
244+
Sign in with Custos*
245+
</BButton>
246+
</BButtonGroup>
235247

236-
<BFormGroup v-if="toggleCilogon">
248+
<BFormGroup v-if="toggleCilogon" class="mt-1">
237249
<Multiselect
238250
v-model="selected"
239251
placeholder="Select your institution"
@@ -246,9 +258,10 @@ function getIdpPreference() {
246258

247259
<BButton
248260
v-if="toggleCilogon"
261+
class="mt-1"
249262
:disabled="loading || selected === null"
250263
@click="submitCILogon(cilogonOrCustos)">
251-
Login*
264+
Login via {{ cilogonOrCustos === "cilogon" ? "CILogon" : "Custos" }} *
252265
</BButton>
253266
</BFormGroup>
254267
</div>

0 commit comments

Comments
 (0)