useFingerprint.ts 422 B

123456789101112131415161718
  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