From e43c89e49cff767ab9678e6a614dbf766fff09fa Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 1 Feb 2024 23:17:46 -0100 Subject: [PATCH] Added accounts passthrough views so more account functionality should work --- package-lock.json | 4 ++-- package.json | 2 +- src/router/index.js | 41 ++++++++++++++++++++++++++++++++++++++ src/views/AccountsForm.vue | 30 ++++++++++++++++++++++++++++ src/views/AccountsGet.vue | 0 5 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 src/views/AccountsForm.vue create mode 100644 src/views/AccountsGet.vue diff --git a/package-lock.json b/package-lock.json index 80b5d60..86bc601 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ocs-example-frontend", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ocs-example-frontend", - "version": "0.1.1", + "version": "0.1.2", "dependencies": { "@vue/composition-api": "^1.0.0-rc.7", "bootstrap": "^4.5.3", diff --git a/package.json b/package.json index 5b69abd..c783742 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ocs-example-frontend", - "version": "0.1.1", + "version": "0.1.2", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/src/router/index.js b/src/router/index.js index 682b4b1..50865e6 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -5,6 +5,8 @@ import RequestgroupsList from "../views/RequestgroupsList.vue"; import Login from "../views/Login.vue"; import Register from '../views/Register.vue'; import Profile from "../views/Profile.vue"; +import AccountsGet from '../views/AccountsGet.vue'; +import AccountsForm from '../views/AccountsForm.vue'; import RequestgroupDetail from "../views/RequestgroupDetail.vue"; import Observations from "../views/Observations.vue"; import ObservationDetail from "../views/ObservationDetail.vue"; @@ -90,6 +92,45 @@ const routes = [ component: Register, meta: { title: 'Register for an account' + }, + // if user is authenticated, redirect to homepage + beforeEnter (to, from, next) { + if (store.state.userIsAuthenticated) { + next('/'); + } + else { + next(); + } + } + }, + { + path: '/accounts/password/reset/confirm/:id/set-password', + name: 'passwordResetConfirmSetPassword', + component: AccountsForm + }, + { + path: '/accounts/password/reset/confirm/:id/:anotherId', + name: 'passwordResetConfirm', + component: AccountsGet, + props: { + successRedirectViewName: 'passwordResetConfirmSetPassword' + } + }, + { + path: '/accounts/password/reset', + name: 'passwordReset', + component: AccountsForm + }, + { + path: '/accounts/password/change', + name: 'passwordChange', + component: AccountsForm + }, + { + path: '/accounts/*', + component: AccountsGet, + meta: { + title: 'Accounts' } }, { diff --git a/src/views/AccountsForm.vue b/src/views/AccountsForm.vue new file mode 100644 index 0000000..619daf6 --- /dev/null +++ b/src/views/AccountsForm.vue @@ -0,0 +1,30 @@ + + + \ No newline at end of file diff --git a/src/views/AccountsGet.vue b/src/views/AccountsGet.vue new file mode 100644 index 0000000..e69de29