File tree Expand file tree Collapse file tree 2 files changed +16
-12
lines changed
Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ DC_API_KEY=
88# https://console.upstash.com/qstash
99QSTASH_CURRENT_SIGNING_KEY =
1010QSTASH_NEXT_SIGNING_KEY =
11+ # Qstash can be removed if using Vercel Cron
12+ # https://vercel.com/docs/cron-jobs/quickstart
13+ # DC cron endpoint: frame/send-notifications
14+ # /frame/[[...routes]]/route.tsx line 44 - 61 can be removed and verified with vercel cron env
1115
1216NEXT_PUBLIC_SITE_URL =
1317NEXT_PUBLIC_GOOGLE_ANALYTICS_ID =
Original file line number Diff line number Diff line change @@ -49,25 +49,25 @@ app.hono.post("/send-notifications", async (c) => {
4949 }
5050 const body = await c . req . text ( ) ;
5151 const currentDay = getCurrentDateUTC ( ) ;
52+
53+ const isValid = await qstashReceiver
54+ . verify ( {
55+ body,
56+ signature,
57+ } )
58+ . catch ( ( e ) => false ) ;
59+
60+ if ( ! isValid ) {
61+ return c . json ( { error : "Invalid signature" } , 400 ) ;
62+ }
63+
5264 const notificationMessage = `
5365 Day ${ currentDay } NFT is now mintable!.
5466
5567 ${ config . PROD_URL } /frame/dc
5668
5769 N/B: Unsubscribe from getting these notifications through the frame.
5870 ` ;
59-
60- const isValid = await qstashReceiver
61- . verify ( {
62- body,
63- signature,
64- } )
65- . catch ( ( e ) => false ) ;
66-
67- if ( ! isValid ) {
68- return c . json ( { error : "Invalid signature" } , 400 ) ;
69- }
70-
7171 async function sendUserDCs ( ) {
7272 // const userFids = [846887];
7373 const userFids = await kvStore . smembers ( UNLOCK_REDIS_KEY ) ;
You can’t perform that action at this time.
0 commit comments