@tuwaio/siwx-server 0.4.1 → 0.4.2
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.
- package/README.md +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -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:
|
|
173
|
+
expectedDomain: appUrl.host,
|
|
174
|
+
expectedUri: appUrl.origin,
|
|
173
175
|
requireExpirationTime: true,
|
|
174
176
|
maxIssuedAtAgeSeconds: 300,
|
|
175
177
|
maxSessionLifetimeSeconds: 30 * 60,
|