mantenimento-app 2.2.9 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +97 -34
- package/app.js +541 -85
- package/backend/server.js +346 -23
- package/frontend/public/app.js +541 -85
- package/frontend/public/autologin.html +40 -0
- package/frontend/public/index.html +29 -6
- package/frontend/public/styles.css +66 -0
- package/frontend/public/supabase-config.js +4 -11
- package/package.json +5 -1
- package/scripts/auth-url-check.mjs +166 -0
- package/scripts/create-url-login-token.mjs +52 -0
- package/scripts/manage-donor-users.mjs +229 -0
- package/scripts/sql/grant-donor.sql +22 -0
- package/scripts/sql/revoke-donor.sql +19 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
-- Grant donor/premium entitlement globally (server-side) to selected users.
|
|
2
|
+
-- Usage in Supabase SQL Editor:
|
|
3
|
+
-- 1) Edit the usernames/emails in the WHERE clause.
|
|
4
|
+
-- 2) Run the script.
|
|
5
|
+
|
|
6
|
+
update auth.users
|
|
7
|
+
set raw_user_meta_data =
|
|
8
|
+
coalesce(raw_user_meta_data, '{}'::jsonb)
|
|
9
|
+
|| jsonb_build_object(
|
|
10
|
+
'is_donor', true,
|
|
11
|
+
'role', 'donor'
|
|
12
|
+
)
|
|
13
|
+
where lower(split_part(email, '@', 1)) in ('favagit', 'fabio.vacchino');
|
|
14
|
+
|
|
15
|
+
-- Verification
|
|
16
|
+
select
|
|
17
|
+
id,
|
|
18
|
+
email,
|
|
19
|
+
raw_user_meta_data->>'is_donor' as is_donor,
|
|
20
|
+
raw_user_meta_data->>'role' as role
|
|
21
|
+
from auth.users
|
|
22
|
+
where lower(split_part(email, '@', 1)) in ('favagit', 'fabio.vacchino');
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
-- Revoke donor/premium entitlement globally (server-side) from selected users.
|
|
2
|
+
-- Usage in Supabase SQL Editor:
|
|
3
|
+
-- 1) Edit the usernames/emails in the WHERE clause.
|
|
4
|
+
-- 2) Run the script.
|
|
5
|
+
|
|
6
|
+
update auth.users
|
|
7
|
+
set raw_user_meta_data =
|
|
8
|
+
(coalesce(raw_user_meta_data, '{}'::jsonb) - 'is_donor' - 'isDonor' - 'premium' - 'role')
|
|
9
|
+
where lower(split_part(email, '@', 1)) in ('favagit', 'fabio.vacchino');
|
|
10
|
+
|
|
11
|
+
-- Verification
|
|
12
|
+
select
|
|
13
|
+
id,
|
|
14
|
+
email,
|
|
15
|
+
raw_user_meta_data->>'is_donor' as is_donor,
|
|
16
|
+
raw_user_meta_data->>'role' as role,
|
|
17
|
+
raw_user_meta_data->>'premium' as premium
|
|
18
|
+
from auth.users
|
|
19
|
+
where lower(split_part(email, '@', 1)) in ('favagit', 'fabio.vacchino');
|