blob: 79edc659cb846a474350604f68b449140476bccc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
/**
* Example: Verifying a Digi-ID Callback
*
* This example demonstrates how to verify a callback from a Digi-ID compatible wallet.
* The callback contains a signature that needs to be verified against the original challenge.
*/
// This example assumes you have a basic Express.js server setup.
// Run with: ts-node examples/verify-callback.ts
// Import only what's needed
// In-memory store for demo purposes. Replace with a database in production.
// Store nonce => { expectedUrl: string, timestamp: number }
const nonceStore = new Map<string, { expectedUrl: string; timestamp: number }>();
const NONCE_EXPIRY_MS = 5 * 60 * 1000; // 5 minutes
// ... existing code ...
|