Skip to content

Commit 13f2eb5

Browse files
committed
updated dependencies and server locations
1 parent cd79104 commit 13f2eb5

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

server/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
"license": "ISC",
1414
"description": "",
1515
"devDependencies": {
16+
"@types/axios": "^0.14.4",
1617
"@types/jest": "^29.5.14",
18+
"@types/jsonwebtoken": "^9.0.7",
1719
"@types/node": "^22.7.6",
1820
"@types/sqlite3": "^3.1.11",
1921
"jest": "^29.7.0",
@@ -26,10 +28,12 @@
2628
"@types/body-parser": "^1.19.5",
2729
"@types/cors": "^2.8.17",
2830
"@types/express": "^5.0.0",
31+
"axios": "^1.7.8",
2932
"body-parser": "^1.20.3",
3033
"cors": "^2.8.5",
3134
"dotenv": "^16.4.5",
3235
"express": "^4.21.1",
36+
"jsonwebtoken": "^9.0.2",
3337
"openai": "^4.67.3",
3438
"sqlite": "^5.1.1",
3539
"sqlite3": "^5.1.7"

web/src/auth/CASCallback.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useEffect } from 'react';
22

3-
const BACKEND_URL = 'https://localhost:3000'; // Replace with your backend URL
3+
const BACKEND_URL = 'https://starr-lab-server.usask.ca/api'; // Replace with your backend URL
44

55
const CASCallback: React.FC = () => {
66
useEffect(() => {

web/src/auth/ProtectedRoute.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
function redirectToCAS() {
2-
const CAS_SERVER = 'https://cas.usask.ca/cas';
3-
const FRONTEND_URL = 'https://localhost:5173/';
4-
const serviceURL = `${FRONTEND_URL}/cas-callback`;
5-
6-
window.location.href = `${CAS_SERVER}/login?service=${encodeURIComponent(serviceURL)}`;
7-
}
2+
const CAS_SERVER = "https://cas.usask.ca/cas";
3+
const FRONTEND_URL = "https://starr-lab-server.usask.ca:5173/";
4+
const serviceURL = `${FRONTEND_URL}/cas-callback`;
85

6+
window.location.href = `${CAS_SERVER}/login?service=${encodeURIComponent(
7+
serviceURL
8+
)}`;
9+
}
910

10-
export default function ProtectedRoute({ children }: { children: JSX.Element}) {
11-
const token = localStorage.getItem('jwt');
11+
export default function ProtectedRoute({
12+
children,
13+
}: {
14+
children: JSX.Element;
15+
}) {
16+
const token = localStorage.getItem("jwt");
1217

1318
if (!token) {
1419
redirectToCAS(); // Redirect to CAS login if no JWT
1520
return null; // Optional: Display a loading spinner while redirecting
1621
}
1722

1823
return children;
19-
};
20-
21-
22-
24+
}

web/vite.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@ import react from '@vitejs/plugin-react'
44
// https://vite.dev/config/
55
export default defineConfig({
66
plugins: [react()],
7+
server: {
8+
port: 5173,
9+
proxy: {
10+
11+
}
12+
}
713
})

0 commit comments

Comments
 (0)