Skip to content

Commit

Permalink
Fix cookie, undefined bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
kthchew committed Apr 23, 2024
1 parent 01c0928 commit 08dbc70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Backend/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ const httpLocalhost = /^http:\/\/localhost:[0-9]{1,5}$/;
const stagingVercelDeployments = /^https:\/\/catcorp-frontend-.*-kenneths-projects-[a-z0-9]{8}\.vercel\.app$/;
app.use(cors({ origin: ["https://catcorp.vercel.app", "https://catcorporation.vercel.app", httpLocalhost, stagingVercelDeployments], credentials: true }));
app.use(_json());
const usingLocalhost = !process.env.VITE_BACKEND_URL || httpLocalhost.test(process.env.VITE_BACKEND_URL);
app.use(session({
name: 'session',
secret: SESSION_SECRET,
maxAge: 24 * 60 * 60 * 1000, // 1 day
sameSite: 'none',
sameSite: usingLocalhost ? 'lax' : 'none',
partitioned: true,
secure: usingLocalhost ? false : true,
}))
app.use(lusca({
csrf: true,
Expand Down
8 changes: 4 additions & 4 deletions Frontend/src/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ function Home({ userData, setUserData, courses, setCourses, bossData, overlay, s
<img src={upcomingButton} className="function"></img>
</div>
<div className='backOverlay'>
<img onClick={() => setOverlay('store')} src={StoreButton} title="Store" style={{opacity:0}}></img>
<img onClick={() => setOverlay('rewards')} src={rewardButton} title="Check Rewards"style={{opacity:0}}></img>
<img onClick={() => setOverlay('checklist')} src={upcomingButton} title="Upcoming Assignments"style={{opacity:0}}></img>
<img onClick={() => setOverlay('bosses')} src={upcomingButton} title="View Bossfights"style={{opacity:0}}></img>
<img onClick={() => {if (courses) setOverlay('store')}} src={StoreButton} title="Store" style={{opacity:0}}></img>
<img onClick={() => {if (courses) setOverlay('rewards')}} src={rewardButton} title="Check Rewards"style={{opacity:0}}></img>
<img onClick={() => {if (courses) setOverlay('checklist')}} src={upcomingButton} title="Upcoming Assignments"style={{opacity:0}}></img>
<img onClick={() => {if (courses) setOverlay('bosses')}} src={upcomingButton} title="View Bossfights"style={{opacity:0}}></img>
</div>
<div className='wall'>
</div>
Expand Down

0 comments on commit 08dbc70

Please sign in to comment.