From 9370590f2174825d715296b776593d0aa4011d9c Mon Sep 17 00:00:00 2001 From: David Ma <40131297+davidma415@users.noreply.github.com> Date: Wed, 22 May 2024 10:21:44 -0600 Subject: [PATCH] fix: autoselect auth strategy if there is only one (#514) --- src/views/Applications/ApplicationForm.vue | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/views/Applications/ApplicationForm.vue b/src/views/Applications/ApplicationForm.vue index 68f0c8e0..5f8ecf64 100644 --- a/src/views/Applications/ApplicationForm.vue +++ b/src/views/Applications/ApplicationForm.vue @@ -46,7 +46,7 @@ authStrat.selected === true) - if (selected) { - formData.value.auth_strategy_id = selected.value - appIsDcr.value = selected.isDcr - selectedAuthStrategy.value = selected - appIsSelfManaged.value = selected.isSelfManaged + if (prefilledAuthStrategy) { + if (hasOneAvailableAuthStrategy) { + prefilledAuthStrategy.selected = true + } + + formData.value.auth_strategy_id = prefilledAuthStrategy.value + appIsDcr.value = prefilledAuthStrategy.isDcr + selectedAuthStrategy.value = prefilledAuthStrategy + appIsSelfManaged.value = prefilledAuthStrategy.isSelfManaged } fetchingAuthStrategies.value = false