Spaces:
Sleeping
Sleeping
Update app.js
Browse files
app.js
CHANGED
|
@@ -206,6 +206,7 @@ app.post('/handshake', async (req, res) => {
|
|
| 206 |
if (intent === 'register' && targetHandle) {
|
| 207 |
const handle = targetHandle.toLowerCase().trim();
|
| 208 |
|
|
|
|
| 209 |
const { data: existing } = await supabase.from('ginger_handles').select('pub_key').eq('handle', handle).maybeSingle();
|
| 210 |
if (existing && existing.pub_key !== buyer_pub_key) {
|
| 211 |
return res.json({ type: 'CANCEL', reason: `Handle '${handle}' is already registered to another cryptographic key.` });
|
|
|
|
| 206 |
if (intent === 'register' && targetHandle) {
|
| 207 |
const handle = targetHandle.toLowerCase().trim();
|
| 208 |
|
| 209 |
+
// 🔒 ANTI-HIJACK SHIELD: Verify if handle is claimed by another public key
|
| 210 |
const { data: existing } = await supabase.from('ginger_handles').select('pub_key').eq('handle', handle).maybeSingle();
|
| 211 |
if (existing && existing.pub_key !== buyer_pub_key) {
|
| 212 |
return res.json({ type: 'CANCEL', reason: `Handle '${handle}' is already registered to another cryptographic key.` });
|