Allow custom label for auth provider (#15673)

* Allow to pass custom label for auth provider

* Add tests

* Update api/src/cli/utils/create-env/env-stub.liquid

* Fix tests

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
This commit is contained in:
José Varela
2022-10-15 04:14:00 +01:00
committed by GitHub
parent ef895fb784
commit da2998a7e7
6 changed files with 91 additions and 2 deletions

View File

@@ -12,7 +12,7 @@
<v-icon :name="provider.icon" />
</div>
<div class="sso-title">
{{ t('log_in_with', { provider: provider.name }) }}
{{ t('log_in_with', { provider: provider.label }) }}
</div>
</a>
</template>
@@ -50,7 +50,8 @@ export default defineComponent({
ssoProviders.value = providers.value
.filter((provider: AuthProvider) => AUTH_SSO_DRIVERS.includes(provider.driver))
.map((provider: AuthProvider) => ({
name: formatTitle(provider.name),
name: provider.name,
label: provider.label || formatTitle(provider.name),
link: `${getRootPath()}auth/login/${provider.name}?redirect=${window.location.href.replace(
location.search,
''

View File

@@ -2,4 +2,5 @@ export interface AuthProvider {
driver: string;
name: string;
icon?: string;
label: string;
}