feat: redirect to OAuth provider when selecting non-form strategy

pull/7973/head
Gabriel Mowses (Mouse) 2 weeks ago
parent b24e1cf2cc
commit e75c84a11d

@ -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
*/

Loading…
Cancel
Save