Skip to content

Commit f16fee1

Browse files
chore: test exchange metadata and add key expiry (#4707)
1 parent 8bdc0b4 commit f16fee1

4 files changed

Lines changed: 22 additions & 4 deletions

File tree

apps/pay-test-exchange/app/api/update/route.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { NextRequest, NextResponse } from 'next/server'
33

44
import { Session } from '@/lib/types'
55

6+
// 72 hours
7+
const EXPIRY_SECONDS = 60 * 60 * 72
8+
69
interface UpdateSessionRequest {
710
status: Session['status']
811
}
@@ -24,7 +27,10 @@ export async function POST(request: NextRequest) {
2427
JSON.stringify({
2528
status: 'pending',
2629
createdAt: new Date().toISOString()
27-
} as Session)
30+
} as Session),
31+
{
32+
expirationTtl: EXPIRY_SECONDS
33+
}
2834
)
2935

3036
return NextResponse.json({ message: 'Session created' }, { status: 200 })
@@ -45,7 +51,9 @@ export async function POST(request: NextRequest) {
4551
session.txid = '0x9b629147b75dc0b275d478fa34d97c5d4a26926457540b15a5ce871df36c23fd'
4652
}
4753

48-
await env.SESSIONID_STORAGE.put(sessionId, JSON.stringify(session))
54+
await env.SESSIONID_STORAGE.put(sessionId, JSON.stringify(session), {
55+
expirationTtl: EXPIRY_SECONDS
56+
})
4957

5058
return NextResponse.json({ message: 'Session updated' }, { status: 200 })
5159
}

apps/pay-test-exchange/app/layout.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,18 @@ import { cn } from '@/lib/utils'
77
import './globals.css'
88

99
export const metadata: Metadata = {
10-
title: 'Create Next App',
11-
description: 'Generated by create next app'
10+
title: 'AppKit Pay Test Exchange',
11+
description: 'AppKit Pay Test Exchange',
12+
icons: [
13+
{
14+
url: '/favicon.png',
15+
media: '(prefers-color-scheme: light)'
16+
},
17+
{
18+
url: '/favicon-dark.png',
19+
media: '(prefers-color-scheme: dark)'
20+
}
21+
]
1222
}
1323

1424
export default function RootLayout({
1.7 KB
Loading
1.59 KB
Loading

0 commit comments

Comments
 (0)