mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-26 00:34:19 +01:00
Upgrade nostr-tools, fix BECH_32_REGEX imports
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { lodash, nip19, nip21, z } from '@/deps.ts';
|
||||
import { lodash, nip19, z } from '@/deps.ts';
|
||||
import { AppController } from '@/app.ts';
|
||||
import { parseBody } from '@/utils.ts';
|
||||
|
||||
@@ -96,7 +96,7 @@ function maybeDecodeUri(uri: string): string {
|
||||
|
||||
const oauthAuthorizeSchema = z.object({
|
||||
pubkey: z.string().regex(/^[0-9a-f]{64}$/).optional().catch(undefined),
|
||||
nip19: z.string().regex(new RegExp(`^${nip21.BECH32_REGEX.source}$`)).optional().catch(undefined),
|
||||
nip19: z.string().regex(new RegExp(`^${nip19.BECH32_REGEX.source}$`)).optional().catch(undefined),
|
||||
redirect_uri: z.string().url(),
|
||||
}).superRefine((data, ctx) => {
|
||||
if (!data.pubkey && !data.nip19) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AppController } from '@/app.ts';
|
||||
import { nip21 } from '@/deps.ts';
|
||||
import { nip19 } from '@/deps.ts';
|
||||
import { signStreams } from '@/sign.ts';
|
||||
|
||||
const streamingController: AppController = (c) => {
|
||||
@@ -17,7 +17,7 @@ const streamingController: AppController = (c) => {
|
||||
return c.json({ error: 'Missing access token' }, 401);
|
||||
}
|
||||
|
||||
if (!nip21.BECH32_REGEX.test(token)) {
|
||||
if (!nip19.BECH32_REGEX.test(token)) {
|
||||
return c.json({ error: 'Invalid access token' }, 401);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user