Upgrade nostr-tools, fix BECH_32_REGEX imports

This commit is contained in:
Alex Gleason
2023-05-20 12:28:12 -05:00
parent 91bc0549c7
commit 9500ceee7c
5 changed files with 9 additions and 9 deletions

View File

@@ -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) {

View File

@@ -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);
}