useFingerprint.ts 423 B

12345678910111213141516171819
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { useLocalStorage } from '@vueuse/core'
  3. import { generateFingerprint } from '#shared/utils/browser.ts'
  4. const useFingerprint = () => {
  5. const fingerprint = useLocalStorage('fingerprint', '')
  6. if (!fingerprint.value) {
  7. fingerprint.value = generateFingerprint()
  8. }
  9. return {
  10. fingerprint,
  11. }
  12. }
  13. export default useFingerprint