@tuwaio/siwx-server 0.4.1 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +4 -2
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -113,7 +113,7 @@ export const { GET, POST, DELETE } = createSiwxApiHandler({
113
113
  policy: {
114
114
  expectedDomain: 'app.tuwa.io',
115
115
  expectedUri: 'https://app.tuwa.io',
116
- allowedChainIds: ['eip155:1', 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpK'],
116
+ allowedChainIds: ['eip155:1', 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp'],
117
117
  requireExpirationTime: true,
118
118
  maxIssuedAtAgeSeconds: 300,
119
119
  },
@@ -165,11 +165,13 @@ import { createStatelessDemoSiwxHandler } from '@tuwaio/siwx-server/next';
165
165
 
166
166
  const signingSecret = process.env.SIWX_DEMO_SIGNING_SECRET; // server-only, at least 32 characters
167
167
  if (!signingSecret) throw new Error('SIWX_DEMO_SIGNING_SECRET is not set');
168
+ const appUrl = new URL(process.env.NEXT_PUBLIC_APP_URL ?? 'http://localhost:3000'); // the origin users open
168
169
 
169
170
  export const { GET, POST, DELETE } = createStatelessDemoSiwxHandler({
170
171
  signingSecret,
171
172
  policy: {
172
- expectedDomain: 'demo.tuwa.io',
173
+ expectedDomain: appUrl.host,
174
+ expectedUri: appUrl.origin,
173
175
  requireExpirationTime: true,
174
176
  maxIssuedAtAgeSeconds: 300,
175
177
  maxSessionLifetimeSeconds: 30 * 60,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuwaio/siwx-server",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "private": false,
5
5
  "author": "Oleksandr Tkach",
6
6
  "license": "Apache-2.0",
@@ -67,9 +67,9 @@
67
67
  }
68
68
  ],
69
69
  "peerDependencies": {
70
- "@tuwaio/siwx-core": "0.4.0",
71
- "@tuwaio/siwx-evm": "0.4.1",
72
- "@tuwaio/siwx-solana": "0.4.1",
70
+ "@tuwaio/siwx-core": "0.4.1",
71
+ "@tuwaio/siwx-evm": "0.4.2",
72
+ "@tuwaio/siwx-solana": "0.4.2",
73
73
  "viem": ">=2"
74
74
  },
75
75
  "peerDependenciesMeta": {
@@ -84,9 +84,9 @@
84
84
  }
85
85
  },
86
86
  "devDependencies": {
87
- "@tuwaio/siwx-core": "0.4.0",
88
- "@tuwaio/siwx-evm": "0.4.1",
89
- "@tuwaio/siwx-solana": "0.4.1",
87
+ "@tuwaio/siwx-core": "0.4.1",
88
+ "@tuwaio/siwx-evm": "0.4.2",
89
+ "@tuwaio/siwx-solana": "0.4.2",
90
90
  "tsup": "^8.5.1",
91
91
  "typescript": "6.0.3",
92
92
  "viem": "^2.57.1"