turns-00042.parquet:39779
37bfb4050d8c4930f1d2f69b
turn 1/1gpt-4o-2024-08-06EnglishUnited States262 words
degenerate_repetitionAbsentFinal dense release
USER
Based on the list of files and changes below, please help me create a title for the commit message. Following the title, provide a short, easy-to-understand description of the changes along with inserting appropriate emojis to make the title and description more eye-catching and interesting:
File: src/views/apps/ecommerce/cmsmart/client-view/work-app/portfolioDetail/PortfolioDetail.js
Changes:
diff --git a/src/views/apps/ecommerce/cmsmart/client-view/work-app/portfolioDetail/PortfolioDetail.js b/src/views/apps/ecommerce/cmsmart/client-view/work-app/portfolioDetail/PortfolioDetail.js
index 32c94d1d..d36abb50 100644
--- a/src/views/apps/ecommerce/cmsmart/client-view/work-app/portfolioDetail/PortfolioDetail.js
+++ b/src/views/apps/ecommerce/cmsmart/client-view/work-app/portfolioDetail/PortfolioDetail.js
@@ -1,4 +1,5 @@
-import React from "react";
+import { useEffect } from "react";
+import { isUserLoggedIn, getUserData } from '@utils'
import { useLocation } from "react-router-dom";
import BreadCrumbs from "@components/breadcrumbs";
import { Helmet } from "react-helmet";
@@ -6,6 +7,14 @@ import { Helmet } from "react-helmet";
const PortfolioDetail = () => {
let data = useLocation();
const alias = data?.state?.portfolio?.attributes?.alias;
+
+ useEffect(() => {
+ if (isUserLoggedIn) {
+ const iframe = document.querySelector('iframe');
+ iframe.contentWindow.postMessage({ token: getUserData()?.data?.jwt }, 'https://workplace.cloodo.com');
+ }
+ }, [isUserLoggedIn]);
+
return (
<div>
<Helmet>
@@ -20,7 +29,7 @@ const PortfolioDetail = () => {
<iframe
src={`https://workplace.cloodo.com/project/${alias}?hide=cms`}
frameborder="0"
- style={{ width: "100%", height:"1500px" }}
+ style={{ width: "100%", height: "1500px" }}
/>
<div
style={{
ASSISTANT
### 🌟 Enhance PortfolioDetail.js with User Authentication #### Description: 🔒 **Enhancements Made**: - Added `useEffect` with authentication checks using `isUserLoggedIn` to confirm if a user is logged in. - Implemented message passing to an iframe for authenticated users by using `postMessage` to send a JWT token to the specified domain. - Improved code readability and consistency by addressing minor formatting adjustments. By incorporating these changes, this update enhances security through user authentication and facilitates seamless communication with external domains for logged-in users. 🌐🔗