From 3a82baec9d793edf81ac2b151b0f4d4159641375 Mon Sep 17 00:00:00 2001
From: Freya Murphy <freya@freyacat.org>
Date: Mon, 1 Apr 2024 11:09:25 -0400
Subject: login and register, liking on homepage

---
 db/rest/login/_api_sign_jwt.sql | 33 ---------------------------------
 1 file changed, 33 deletions(-)
 delete mode 100644 db/rest/login/_api_sign_jwt.sql

(limited to 'db/rest/login/_api_sign_jwt.sql')

diff --git a/db/rest/login/_api_sign_jwt.sql b/db/rest/login/_api_sign_jwt.sql
deleted file mode 100644
index dc8e920..0000000
--- a/db/rest/login/_api_sign_jwt.sql
+++ /dev/null
@@ -1,33 +0,0 @@
-CREATE FUNCTION _api.sign_jwt(
-	_role TEXT,
-	_user_id INTEGER
-)
-RETURNS sys.JWT
-LANGUAGE plpgsql VOLATILE
-AS $BODY$
-DECLARE
-	_jwt_secret TEXT;
-	_token sys.JWT;
-BEGIN
-	SELECT jwt_secret INTO _jwt_secret
-	FROM sys.database_info
-	WHERE name = current_database();
-
-	SELECT public.sign(
-		row_to_json(r), _jwt_secret
-	) INTO _token
-	FROM (
-		SELECT
-			_role AS role,
-			_user_id AS user_id,
-			extract(epoch FROM now())::integer + (60 * 60 * 24) AS exp
-	) r;
-
-	RETURN _token;
-END
-$BODY$;
-
-GRANT EXECUTE ON FUNCTION _api.sign_jwt(TEXT, INTEGER)
-	TO rest_anon, rest_user;
-GRANT SELECT ON TABLE sys.database_info
-	TO rest_anon, rest_user;
-- 
cgit v1.2.3-freya

