Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions client/modules/IDE/components/ShareModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ class ShareModal extends React.PureComponent {
<h3 className="share-modal__project-name">{projectName}</h3>
<CopyableInput
label={this.props.t('ShareModal.Embed')}
value={`<iframe src="${previewUrl}/${ownerUsername}/embed/${projectId}"></iframe>`}
value={`<iframe src="${hostname}/${ownerUsername}/full/${projectId}"></iframe>`}
/>
<CopyableInput
{/* CAT removing due to phishing issues */}
{/* <CopyableInput
label={this.props.t('ShareModal.Present')}
hasPreviewLink
value={`${previewUrl}/${ownerUsername}/present/${projectId}`}
/>
/> */}
<CopyableInput
label={this.props.t('ShareModal.Fullscreen')}
hasPreviewLink
Expand Down
21 changes: 18 additions & 3 deletions server/routes/embed.routes.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
import { Router } from 'express';
import * as EmbedController from '../controllers/embed.controller';

const editorUrl = process.env.EDITOR_URL;

const router = new Router();

router.get('/:username/embed/:project_id', EmbedController.serveProject);
router.get('/:username/present/:project_id', EmbedController.serveProject);
router.get('/embed/:project_id', EmbedController.serveProject);
// CAT redirecting these temporarily to editor URLS to prevent phishing
// router.get('/:username/embed/:project_id', EmbedController.serveProject);
router.get('/:username/embed/:project_id', (req, res) => {
const { username, project_id: projectId } = req.params;
res.redirect(301, `${editorUrl}/${username}/full/${projectId}`);
});
// router.get('/:username/present/:project_id', EmbedController.serveProject);
router.get('/:username/present/:project_id', (req, res) => {
const { username, project_id: projectId } = req.params;
res.redirect(301, `${editorUrl}/${username}/full/${projectId}`);
});
// router.get('/embed/:project_id', EmbedController.serveProject);
router.get('/embed/:project_id', (req, res) => {
const { project_id: projectId } = req.params;
res.redirect(301, `${editorUrl}/full/${projectId}`);
});

export default router;
12 changes: 9 additions & 3 deletions server/routes/redirectEmbed.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,23 @@ const previewUrl = process.env.PREVIEW_URL;

router.get('/:username/embed/:project_id', (req, res) => {
const { username, project_id: projectId } = req.params;
res.redirect(301, `${previewUrl}/${username}/embed/${projectId}`);
// CAT changing due to ongoing phishing issues
// res.redirect(301, `${previewUrl}/${username}/embed/${projectId}`);
res.redirect(301, `/${username}/full/${projectId}`);
});

router.get('/:username/present/:project_id', (req, res) => {
const { username, project_id: projectId } = req.params;
res.redirect(301, `${previewUrl}/${username}/present/${projectId}`);
// CAT changing due to ongoing phishing issues
// res.redirect(301, `${previewUrl}/${username}/present/${projectId}`);
res.redirect(301, `/${username}/full/${projectId}`);
});

router.get('/embed/:project_id', (req, res) => {
const { project_id: projectId } = req.params;
res.redirect(301, `${previewUrl}/embed/${projectId}`);
// CAT changing due to ongoing phishing issues
// res.redirect(301, `${previewUrl}/embed/${projectId}`);
res.redirect(301, `/full/${projectId}`);
});

export default router;