Skip to content

Commit e43c89e

Browse files
author
Jon
committed
Added accounts passthrough views so more account functionality should work
1 parent f1147d2 commit e43c89e

File tree

5 files changed

+74
-3
lines changed

5 files changed

+74
-3
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ocs-example-frontend",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"private": true,
55
"scripts": {
66
"serve": "vue-cli-service serve",

src/router/index.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import RequestgroupsList from "../views/RequestgroupsList.vue";
55
import Login from "../views/Login.vue";
66
import Register from '../views/Register.vue';
77
import Profile from "../views/Profile.vue";
8+
import AccountsGet from '../views/AccountsGet.vue';
9+
import AccountsForm from '../views/AccountsForm.vue';
810
import RequestgroupDetail from "../views/RequestgroupDetail.vue";
911
import Observations from "../views/Observations.vue";
1012
import ObservationDetail from "../views/ObservationDetail.vue";
@@ -90,6 +92,45 @@ const routes = [
9092
component: Register,
9193
meta: {
9294
title: 'Register for an account'
95+
},
96+
// if user is authenticated, redirect to homepage
97+
beforeEnter (to, from, next) {
98+
if (store.state.userIsAuthenticated) {
99+
next('/');
100+
}
101+
else {
102+
next();
103+
}
104+
}
105+
},
106+
{
107+
path: '/accounts/password/reset/confirm/:id/set-password',
108+
name: 'passwordResetConfirmSetPassword',
109+
component: AccountsForm
110+
},
111+
{
112+
path: '/accounts/password/reset/confirm/:id/:anotherId',
113+
name: 'passwordResetConfirm',
114+
component: AccountsGet,
115+
props: {
116+
successRedirectViewName: 'passwordResetConfirmSetPassword'
117+
}
118+
},
119+
{
120+
path: '/accounts/password/reset',
121+
name: 'passwordReset',
122+
component: AccountsForm
123+
},
124+
{
125+
path: '/accounts/password/change',
126+
name: 'passwordChange',
127+
component: AccountsForm
128+
},
129+
{
130+
path: '/accounts/*',
131+
component: AccountsGet,
132+
meta: {
133+
title: 'Accounts'
93134
}
94135
},
95136
{

src/views/AccountsForm.vue

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<template>
2+
<b-row>
3+
<b-col>
4+
<passthrough-form :endpoint="endpoint" :success-redirect-view-name="successRedirectViewName" />
5+
<br />
6+
</b-col>
7+
</b-row>
8+
</template>
9+
<script>
10+
import PassthroughForm from '@/components/PassthroughForm.vue';
11+
12+
export default {
13+
name: 'AccountsPassthroughFormPage',
14+
components: {
15+
PassthroughForm
16+
},
17+
props: {
18+
successRedirectViewName: {
19+
type: String,
20+
default: ''
21+
}
22+
},
23+
data: function() {
24+
return {
25+
endpoint: this.$route.path
26+
};
27+
}
28+
};
29+
</script>
30+

src/views/AccountsGet.vue

Whitespace-only changes.

0 commit comments

Comments
 (0)