mirror of
https://github.com/teableio/teable
synced 2024-11-21 06:42:28 +00:00
feat: allow embed share view into iframe (#257)
This commit is contained in:
parent
44023b56c7
commit
265a468d61
@ -1,3 +1,3 @@
|
|||||||
tasks:
|
tasks:
|
||||||
- init: yarn install
|
- init: pnpm install
|
||||||
command: yarn workspace nextjs-app run dev -p 3000
|
command: make sqlite-mode && cd apps/nestjs-backend && pnpm dev
|
||||||
|
@ -138,7 +138,6 @@ export class ShareDbPermissionService {
|
|||||||
// view share permission validation
|
// view share permission validation
|
||||||
const shareId = context.agent.custom.shareId;
|
const shareId = context.agent.custom.shareId;
|
||||||
if (shareId && isShareViewResourceDoc(docType as IdPrefix)) {
|
if (shareId && isShareViewResourceDoc(docType as IdPrefix)) {
|
||||||
console.log('context.snapshots === ', context.snapshots);
|
|
||||||
const error = await this.checkReadViewSharePermission(
|
const error = await this.checkReadViewSharePermission(
|
||||||
shareId,
|
shareId,
|
||||||
context.collection,
|
context.collection,
|
||||||
|
@ -5,10 +5,14 @@ import { ssrApi } from '@/backend/api/rest/table.ssr';
|
|||||||
import type { IShareViewPageProps } from '@/features/app/blocks/share/view/ShareViewPage';
|
import type { IShareViewPageProps } from '@/features/app/blocks/share/view/ShareViewPage';
|
||||||
import { ShareViewPage } from '@/features/app/blocks/share/view/ShareViewPage';
|
import { ShareViewPage } from '@/features/app/blocks/share/view/ShareViewPage';
|
||||||
|
|
||||||
export const getServerSideProps: GetServerSideProps<IShareViewPageProps> = async (context) => {
|
export const getServerSideProps: GetServerSideProps<IShareViewPageProps> = async ({
|
||||||
const { shareId } = context.query;
|
res,
|
||||||
const req = context.req;
|
req,
|
||||||
|
query,
|
||||||
|
}) => {
|
||||||
|
const { shareId } = query;
|
||||||
try {
|
try {
|
||||||
|
res.setHeader('Content-Security-Policy', "frame-ancestors 'self' *;");
|
||||||
ssrApi.axios.defaults.headers['cookie'] = req.headers.cookie || '';
|
ssrApi.axios.defaults.headers['cookie'] = req.headers.cookie || '';
|
||||||
const shareViewData = await ssrApi.getShareView(shareId as string);
|
const shareViewData = await ssrApi.getShareView(shareId as string);
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user