diff --git a/.env b/.env new file mode 100644 index 0000000..4a87c9a --- /dev/null +++ b/.env @@ -0,0 +1,6 @@ +VITE_API_SERVER_URL=http://localhost:6060 +VITE_AUTH0_DOMAIN=dev-gi0zusfv0z1zvt1x.us.auth0.com +VITE_AUTH0_CLIENT_ID=clCyl1SjISWMmL2iMStXnQzHTBy44wwq +VITE_AUTH0_CALLBACK_URL=http://localhost:5173/callback +VITE_AUTH0_AUDIENCE=https://dev-gi0zusfv0z1zvt1x.us.auth0.com/api/v2/ +# VITE_API_SERVER_URL=https://fuprqaj0n4.execute-api.us-east-1.amazonaws.com/Prod \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 24923c0..e425c31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,8 +8,10 @@ "name": "testing-vue-create", "version": "0.0.0", "dependencies": { + "@auth0/auth0-vue": "^2.3.2", "@unocss/reset": "^0.56.5", - "axios": "^1.5.1", + "@websanova/vue-auth": "^4.2.1", + "axios": "^1.6.2", "vue": "^3.3.4", "vue-router": "^4.2.4" }, @@ -18,6 +20,28 @@ "vite": "^4.4.9" } }, + "node_modules/@auth0/auth0-spa-js": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@auth0/auth0-spa-js/-/auth0-spa-js-2.1.2.tgz", + "integrity": "sha512-xdA65Z/U7++Y7L9Uwh8Q8OVOs6qgFz+fb7GAzHFjpr1icO37B//xdzLXm7ZRgA19RWrsNe1nme3h896igJSvvw==" + }, + "node_modules/@auth0/auth0-vue": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/@auth0/auth0-vue/-/auth0-vue-2.3.2.tgz", + "integrity": "sha512-HV53tLzT6yfRmbfp0pm7BG54i7fm1nIfj8mTd0HrhZP028fuxtyTPN9p+CY7uRvOm12aAxPZXdJlZ8/TVpxmPA==", + "dependencies": { + "@auth0/auth0-spa-js": "^2.1.2", + "vue": "^3.2.41" + }, + "peerDependencies": { + "vue-router": "^4.0.12" + }, + "peerDependenciesMeta": { + "vue-router": { + "optional": true + } + } + }, "node_modules/@babel/parser": { "version": "7.23.0", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", @@ -514,15 +538,20 @@ "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.4.tgz", "integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==" }, + "node_modules/@websanova/vue-auth": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@websanova/vue-auth/-/vue-auth-4.2.1.tgz", + "integrity": "sha512-gc4WL3WzJMkj3wZmrBAP7U7WBAcVY0/a/YhCzMVR/iA1u/8QJlugq/320CRRbZ0Acz+qbGPhdm07IRE3U053yg==" + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz", - "integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", + "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", "dependencies": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", diff --git a/package.json b/package.json index a1953b4..b234506 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,10 @@ "preview": "vite preview" }, "dependencies": { + "@auth0/auth0-vue": "^2.3.2", "@unocss/reset": "^0.56.5", - "axios": "^1.5.1", + "@websanova/vue-auth": "^4.2.1", + "axios": "^1.6.2", "vue": "^3.3.4", "vue-router": "^4.2.4" }, diff --git a/src/App.vue b/src/App.vue index cbc3827..390003b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -14,12 +14,14 @@ export default { data() { return { tabs: [ - { path: '/', label: 'Home' }, - { path: '/fetch', label: 'Create an Account' }, + { path: '/home', label: 'Home' }, + //{ path: '/fetch', label: 'Create an Account' }, { path: { name: 'search' }, label: 'Course Search' }, { path: '/schedule', label: 'Schedule View' }, { path: '/admin/createcourse', label: 'Create Course' }, - { path: '/login', label: 'Login' }, + //{ path: '/login', label: 'Login' }, + { path: '/', label: 'Login' }, + { path: '/profile', label: 'Profile' }, ] }; }, @@ -28,4 +30,4 @@ export default { Footer } }; - + \ No newline at end of file diff --git a/src/components/AppHeader.vue b/src/components/AppHeader.vue index 44800f9..6070420 100644 --- a/src/components/AppHeader.vue +++ b/src/components/AppHeader.vue @@ -20,12 +20,14 @@ const title = 'Course Registration'; const tabs = [ { path: '/', label: 'Home' }, - { path: '/fetch', label: 'Create an Account' }, + //{ path: '/fetch', label: 'Create an Account' }, { path: { name: 'search' }, label: 'Course Search' }, { path: '/schedule', label: 'Schedule View' }, { path: '/mycourses', label: 'Course View' }, { path: '/admin/createcourse', label: 'Create Course' }, - { path: '/login', label: 'Login' }, + //{ path: '/login', label: 'Login' }, + { path: '/test', label: 'Test'}, + { path: '/profile', label: 'Profile' }, ]; const route = useRoute(); diff --git a/src/components/Header.vue b/src/components/Header.vue index 4d8f655..da5beb4 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -1,75 +1,74 @@ - - - - - \ No newline at end of file +}; + + + diff --git a/src/main.js b/src/main.js index 7a9c7a8..296d602 100644 --- a/src/main.js +++ b/src/main.js @@ -1,11 +1,26 @@ import "./assets/main.css"; +//Added for Auth) login +import { createAuth0 } from '@auth0/auth0-vue' + import { createApp } from "vue"; import App from "./App.vue"; import router from "./router"; const app = createApp(App); -app.use(router); +//From Lab +app + .use(router) + .use( + createAuth0({ + domain: import.meta.env.VITE_AUTH0_DOMAIN, + clientId: import.meta.env.VITE_AUTH0_CLIENT_ID, + authorizationParams: { + audience: import.meta.env.VITE_AUTH0_AUDIENCE, + redirect_uri: import.meta.env.VITE_AUTH0_CALLBACK_URL, + }, + }) + ) app.mount("#app"); diff --git a/src/router/index.js b/src/router/index.js index 2eeb1d0..f4c9606 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -9,6 +9,8 @@ import LoginPage from "../views/LoginPage.vue"; import SignUp from "../views/SignUp.vue"; import ScheduleView from "../views/ScheduleView.vue"; import StudentCourseView from "../views/StudentCourseView.vue"; +import Test from "../views/Test.vue"; +import Profile from "../views/Profile.vue"; const router = createRouter({ // the history mode determines how vue router interacts with the url. @@ -25,7 +27,7 @@ const router = createRouter({ // and, most importantly, the component that should be rendered for the view routes: [ { - path: "/", + path: "/home", name: "home", component: HomeView, }, @@ -59,6 +61,17 @@ const router = createRouter({ name: "mycourses", component: StudentCourseView, }, + { + path: "/", + name: "Test", + component: Test, + }, + { + path: "/profile", + name: "Profile", + component: Profile, + + }, ], }); diff --git a/src/views/ClassSearch.vue b/src/views/ClassSearch.vue index 6c95ae9..9343d33 100644 --- a/src/views/ClassSearch.vue +++ b/src/views/ClassSearch.vue @@ -1,5 +1,10 @@ diff --git a/src/views/ForgotPassword.vue b/src/views/ForgotPassword.vue new file mode 100644 index 0000000..87887f4 --- /dev/null +++ b/src/views/ForgotPassword.vue @@ -0,0 +1,90 @@ + + + + + \ No newline at end of file diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 37e5663..222a74a 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -5,6 +5,7 @@

Welcome to Section 2 Group 3 University

Explore our vibrant academic community dedicated to excellence.

+
diff --git a/src/views/LoginPage.vue b/src/views/LoginPage.vue index a12b5a1..abb92d1 100644 --- a/src/views/LoginPage.vue +++ b/src/views/LoginPage.vue @@ -1,6 +1,9 @@