mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 02:51:13 -05:00
Fix hash_session_ip function
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
-- Fix hash_session_ip to use pgcrypto from extensions schema
|
||||
CREATE OR REPLACE FUNCTION public.hash_session_ip(session_ip inet)
|
||||
RETURNS text
|
||||
LANGUAGE plpgsql
|
||||
IMMUTABLE
|
||||
SET search_path = 'public', 'extensions'
|
||||
AS $$
|
||||
BEGIN
|
||||
-- Return last 8 chars of SHA256 hash with asterisks prefix for privacy
|
||||
RETURN '****' || RIGHT(encode(digest(session_ip::text || 'session_salt_2025', 'sha256'), 'hex'), 8);
|
||||
END;
|
||||
$$;
|
||||
Reference in New Issue
Block a user