diff --git a/ux/src/components/AuthLoginPanel.vue b/ux/src/components/AuthLoginPanel.vue index af55f862..d13ee0f5 100644 --- a/ux/src/components/AuthLoginPanel.vue +++ b/ux/src/components/AuthLoginPanel.vue @@ -15,7 +15,7 @@ no-caps :color='str.id === state.selectedStrategyId ? `primary` : ($q.dark.isActive ? `blue-grey-9` : `grey-1`)' :text-color='str.id === state.selectedStrategyId || $q.dark.isActive ? `white` : `blue-grey-9`' - @click='state.selectedStrategyId = str.id' + @click='selectStrategy(str)' ) q-form(ref='loginForm', @submit='login') q-input( @@ -611,6 +611,17 @@ async function handleLoginResponse (resp) { } } +/** + * SELECT STRATEGY + */ +function selectStrategy (str) { + state.selectedStrategyId = str.id + // If strategy doesn't use a form (e.g. OIDC/OAuth), redirect to provider + if (!str.activeStrategy.strategy.useForm) { + window.location.assign(`/login/${str.activeStrategy.id}/redirect`) + } +} + /** * LOGIN */