feat: add ability for platforms to define custom login selector ui

This commit is contained in:
Andrew Bastin
2024-06-11 06:20:02 +05:30
parent f13478da86
commit e3ad0c9e2e
2 changed files with 12 additions and 1 deletions

View File

@@ -6,7 +6,11 @@
@close="hideModal"
>
<template #body>
<template v-if="isLoadingAllowedAuthProviders">
<template v-if="platform.auth.customLoginSelectorUI">
<component :is="platform.auth.customLoginSelectorUI" />
</template>
<template v-else-if="isLoadingAllowedAuthProviders">
<div class="flex justify-center">
<HoppSmartSpinner />
</div>

View File

@@ -52,6 +52,13 @@ export type LoginItemDef = {
}
export type AuthPlatformDef = {
/**
* Whether this platform shows a custom login selector UI. Used for situations
* where we don't want to render the traditional UI and want to replace it
* with something else
*/
customLoginSelectorUI?: Component
/**
* Returns an observable that emits the current user as per the auth implementation.
*