LoginThirdParty.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import useFingerprint from '#shared/composables/useFingerprint.ts'
  4. import type { ThirdPartyAuthProvider } from '#shared/types/authentication.ts'
  5. import CommonThirdPartyAuthenticationButton from '#desktop/components/CommonThirdPartyAuthenticationButton/CommonThirdPartyAuthenticationButton.vue'
  6. export interface Props {
  7. providers: ThirdPartyAuthProvider[]
  8. }
  9. const props = defineProps<Props>()
  10. const { fingerprint } = useFingerprint()
  11. </script>
  12. <template>
  13. <section class="mt-2.5 w-full" data-test-id="loginThirdParty">
  14. <div class="mb-2.5 flex justify-center">
  15. <CommonLabel>
  16. {{
  17. $c.user_show_password_login
  18. ? $t('Or sign in using')
  19. : $t('Sign in using')
  20. }}
  21. </CommonLabel>
  22. </div>
  23. <div class="flex flex-wrap gap-2">
  24. <CommonThirdPartyAuthenticationButton
  25. v-for="provider of props.providers"
  26. :key="provider.name"
  27. class="flex min-w-[calc(50%-theme(spacing.2))] grow"
  28. :url="`${provider.url}?fingerprint=${fingerprint}`"
  29. :button-prefix-icon="provider.icon"
  30. button-size="large"
  31. button-block
  32. button-variant="primary"
  33. :button-label="provider.name"
  34. >
  35. {{ $t(provider.label) }}
  36. </CommonThirdPartyAuthenticationButton>
  37. </div>
  38. </section>
  39. </template>