@@ -17,7 +17,6 @@ import { errorMessageAsString } from "@/utils/simple-error";
1717import { capitalizeFirstLetter } from " @/utils/strings" ;
1818
1919import GButton from " @/components/BaseComponents/GButton.vue" ;
20- import GButtonGroup from " @/components/BaseComponents/GButtonGroup.vue" ;
2120import VerticalSeparator from " @/components/Common/VerticalSeparator.vue" ;
2221import LoadingSpan from " @/components/LoadingSpan.vue" ;
2322
@@ -50,34 +49,22 @@ const messageVariant = ref<string | null>(null);
5049const cILogonIdps = ref <Idp []>([]);
5150const selected = ref <Idp | null >(null );
5251const rememberIdp = ref (false );
53- const cilogonOrCustos = ref <" cilogon" | " custos" | null >(null );
54- const toggleCilogon = ref (false );
5552
5653const oIDCIdps = computed <OIDCConfig >(() => (isConfigLoaded .value ? config .value .oidc : {}));
5754
5855const filteredOIDCIdps = computed (() => getFilteredOIDCIdps (oIDCIdps .value , props .excludeIdps ));
5956
60- const cilogonListShow = computed (() => getNeedShowCilogonInstitutionList (oIDCIdps .value ));
61-
62- const cILogonEnabled = computed (() => oIDCIdps .value .cilogon );
63- const custosEnabled = computed (() => oIDCIdps .value .custos );
57+ const cILogonConfigured = computed (() => getNeedShowCilogonInstitutionList (oIDCIdps .value ));
6458
6559onMounted (async () => {
6660 rememberIdp .value = getIdpPreference () !== null ;
6761
68- // Only fetch CILogonIDPs if custos/ cilogon configured
69- if (cilogonListShow .value ) {
62+ // Only fetch CILogonIDPs if cilogon configured
63+ if (cILogonConfigured .value ) {
7064 await getCILogonIdps ();
7165 }
7266});
7367
74- function toggleCILogon(idp : " cilogon" | " custos" ) {
75- if (cilogonOrCustos .value === idp || cilogonOrCustos .value === null ) {
76- toggleCilogon .value = ! toggleCilogon .value ;
77- }
78- cilogonOrCustos .value = toggleCilogon .value ? idp : null ;
79- }
80-
8168async function clickOIDCLogin(idp : string ) {
8269 if (loading .value ) {
8370 return ;
@@ -99,15 +86,15 @@ async function clickOIDCLogin(idp: string) {
9986 }
10087}
10188
102- async function clickCILogin( idp : string | null ) {
89+ async function clickCILogonLogin( ) {
10390 if (loading .value ) {
10491 return ;
10592 }
10693 if (props .loginPage ) {
10794 setIdpPreference ();
10895 }
10996
110- if (! selected .value || ! idp ) {
97+ if (! selected .value ) {
11198 messageVariant .value = " danger" ;
11299 messageText .value = " Please select an institution." ;
113100 return ;
@@ -116,9 +103,9 @@ async function clickCILogin(idp: string | null) {
116103 loading .value = true ;
117104
118105 try {
119- const redirectUri = await submitCILogon (idp , true , selected .value .EntityID );
106+ const redirectUri = await submitCILogon (true , selected .value .EntityID );
120107
121- localStorage .setItem (" galaxy-provider" , idp );
108+ localStorage .setItem (" galaxy-provider" , " cilogon " );
122109
123110 if (redirectUri ) {
124111 window .location .href = redirectUri ;
@@ -183,11 +170,9 @@ function getIdpPreference() {
183170 </BAlert >
184171
185172 <div :class =" { 'd-flex h-100': !props.columnDisplay }" >
186- <!-- OIDC login-->
187- <BForm v-if =" cilogonListShow" id =" externalLogin" class =" cilogon" >
188- <div v-if =" props.loginPage" >
189- <!-- Only Display if CILogon/Custos is configured-->
190- <BFormGroup label =" Use existing institutional login" >
173+ <BForm v-if =" cILogonConfigured" id =" externalLogin" class =" cilogon" >
174+ <div >
175+ <BFormGroup :label =" `Use ${props.loginPage ? `existing` : ``} institutional login`" >
191176 <Multiselect
192177 v-model =" selected"
193178 placeholder =" Select your institution"
@@ -205,72 +190,23 @@ function getIdpPreference() {
205190 </BFormCheckbox >
206191 </BFormGroup >
207192
208- <GButton
209- v-if =" cILogonEnabled"
210- :disabled =" loading || selected === null"
211- @click =" clickCILogin('cilogon')" >
193+ <GButton :disabled =" loading || selected === null" @click =" clickCILogonLogin" >
212194 <LoadingSpan v-if =" loading" message =" Signing In" />
213195 <span v-else >Sign in with Institutional Credentials*</span >
214196 </GButton >
215- <!-- convert to v-else-if to allow only one or the other. if both enabled, put the one that should be default first-->
216- <GButton
217- v-if =" Object.prototype.hasOwnProperty.call(oIDCIdps, 'custos')"
218- :disabled =" loading || selected === null"
219- @click =" clickCILogin('custos')" >
220- <LoadingSpan v-if =" loading" message =" Signing In" />
221- <span v-else >Sign in with Custos*</span >
222- </GButton >
223- </div >
224-
225- <div v-else >
226- <GButtonGroup class =" w-100" >
227- <GButton
228- v-if =" cILogonEnabled"
229- :pressed =" cilogonOrCustos === 'cilogon'"
230- @click =" toggleCILogon('cilogon')" >
231- Sign in with Institutional Credentials*
232- </GButton >
233-
234- <GButton
235- v-if =" custosEnabled"
236- :pressed =" cilogonOrCustos === 'custos'"
237- @click =" toggleCILogon('custos')" >
238- Sign in with Custos*
239- </GButton >
240- </GButtonGroup >
241-
242- <BFormGroup v-if =" toggleCilogon" class =" mt-1" >
243- <Multiselect
244- v-model =" selected"
245- placeholder =" Select your institution"
246- :options =" cILogonIdps"
247- label =" DisplayName"
248- select-label =" "
249- deselect-label =" "
250- :allow-empty =" false"
251- track-by =" EntityID" />
252-
253- <GButton
254- v-if =" toggleCilogon"
255- class =" mt-1"
256- :disabled =" loading || selected === null"
257- @click =" clickCILogin(cilogonOrCustos)" >
258- Login via {{ cilogonOrCustos === "cilogon" ? "CILogon" : "Custos" }} *
259- </GButton >
260- </BFormGroup >
261197 </div >
262198
263199 <p class =" mt-3" >
264200 <small class =" text-muted" >
265- * Galaxy uses CILogon via Custos to enable you to log in from this organization. By clicking
266- 'Sign In', you agree to the
201+ * Galaxy uses CILogon to enable you to log in from this organization. By clicking 'Sign In', you
202+ agree to the
267203 <a href =" https://ca.cilogon.org/policy/privacy" >CILogon</a > privacy policy and you agree to
268- share your username, email address, and affiliation with CILogon, Custos, and Galaxy.
204+ share your username, email address, and affiliation with CILogon and Galaxy.
269205 </small >
270206 </p >
271207 </BForm >
272208
273- <template v-if =" cilogonListShow && Object .keys (filteredOIDCIdps ).length > 0 " >
209+ <template v-if =" cILogonConfigured && Object .keys (filteredOIDCIdps ).length > 0 " >
274210 <VerticalSeparator v-if =" !props.columnDisplay" >
275211 <span v-localize >or</span >
276212 </VerticalSeparator >
0 commit comments