Skip to content

Commit 6e85970

Browse files
[fix] 3 detail bugs
1 parent 4f81188 commit 6e85970

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

pages/api/signature/[...slug].ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { createKoaRouter, withKoaRouter } from 'next-ssr-middleware';
22

3+
import { safeAPI } from '../core';
4+
35
export const config = { api: { bodyParser: false } };
46

57
const router = createKoaRouter(import.meta.url);
68

7-
router.post('/verification', async context => {
9+
router.post('/verification', safeAPI, async context => {
810
const { algorithm, publicKey, value, signature } = Reflect.get(context.request, 'body');
911

1012
const rawAlgorithm = JSON.parse(atob(algorithm)),

pages/signature.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default class SignaturePage extends ObservedComponent<RouteProps, typeof
2424
const { route } = this.observedProps;
2525
const { valueName, algorithmName, publicKeyName, signatureName, value } = route.query,
2626
{ algorithm, publicKey } = this.signatureStore;
27-
const signature = this.signatureStore.signatureMap[value + ''] || {};
27+
const signature = this.signatureStore.signatureMap[value + ''];
2828

2929
return buildURLData({
3030
[valueName + '']: value,
@@ -53,7 +53,11 @@ export default class SignaturePage extends ObservedComponent<RouteProps, typeof
5353

5454
<h1 className="my-5 text-truncate">{title}</h1>
5555

56-
<iframe className="border-0 w-100 vh-100" src={`${iframeLink}?${this.linkData}`} />
56+
<iframe
57+
className="border-0 w-100 vh-100"
58+
sandbox="allow-scripts allow-same-origin allow-forms"
59+
src={`${iframeLink}?${this.linkData}`}
60+
/>
5761
</Container>
5862
);
5963
}

0 commit comments

Comments
 (0)