mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
captcha: resize pieces, require nip98 auth
This commit is contained in:
parent
952d5e4370
commit
68c0d437ee
3 changed files with 6 additions and 6 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 279 KiB After Width: | Height: | Size: 22 KiB |
|
|
@ -280,7 +280,7 @@ app.post('/api/v1/ditto/names', requireSigner, nameRequestController);
|
||||||
app.get('/api/v1/ditto/names', requireSigner, nameRequestsController);
|
app.get('/api/v1/ditto/names', requireSigner, nameRequestsController);
|
||||||
|
|
||||||
app.get('/api/v1/ditto/captcha', captchaController);
|
app.get('/api/v1/ditto/captcha', captchaController);
|
||||||
app.post('/api/v1/ditto/captcha/:id/verify', requireSigner, captchaVerifyController);
|
app.post('/api/v1/ditto/captcha/:id/verify', requireProof(), captchaVerifyController);
|
||||||
|
|
||||||
app.get('/api/v1/ditto/zap_splits', getZapSplitsController);
|
app.get('/api/v1/ditto/zap_splits', getZapSplitsController);
|
||||||
app.get('/api/v1/ditto/:id{[0-9a-f]{64}}/zap_splits', statusZapSplitsController);
|
app.get('/api/v1/ditto/:id{[0-9a-f]{64}}/zap_splits', statusZapSplitsController);
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,10 @@ export const captchaController: AppController = async (c) => {
|
||||||
await Deno.readFile(new URL('../../../captcha/tj-holowaychuk.jpg', import.meta.url)),
|
await Deno.readFile(new URL('../../../captcha/tj-holowaychuk.jpg', import.meta.url)),
|
||||||
await Deno.readFile(new URL('../../../captcha/puzzle.png', import.meta.url)),
|
await Deno.readFile(new URL('../../../captcha/puzzle.png', import.meta.url)),
|
||||||
{
|
{
|
||||||
cw: 300,
|
cw: 370,
|
||||||
ch: 300,
|
ch: 400,
|
||||||
pw: 50,
|
pw: 65,
|
||||||
ph: 50,
|
ph: 65,
|
||||||
alpha: 0.8,
|
alpha: 0.8,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
@ -132,7 +132,7 @@ export const captchaVerifyController: AppController = async (c) => {
|
||||||
return c.json({ error: 'Captcha expired' }, { status: 410 });
|
return c.json({ error: 'Captcha expired' }, { status: 410 });
|
||||||
}
|
}
|
||||||
|
|
||||||
const dim = { w: 50, h: 50 };
|
const dim = { w: 65, h: 65 };
|
||||||
const point = result.data;
|
const point = result.data;
|
||||||
|
|
||||||
const success = areIntersecting(
|
const success = areIntersecting(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue