diff --git a/src/App.vue b/src/App.vue index 1cf9cbd7..96b68a43 100644 --- a/src/App.vue +++ b/src/App.vue @@ -70,7 +70,12 @@
- +
+
+ + +
+
@@ -81,6 +86,7 @@ import auth from './auth' import {HTTP} from './http-common' import message from './message' + import router from './router' export default { name: 'app', @@ -92,6 +98,14 @@ namespaces: [], } }, + beforeMount() { + // Password reset + if(this.$route.query.userPasswordReset !== undefined) { + localStorage.removeItem('passwordResetToken') // Delete an eventually preexisting old token + localStorage.setItem('passwordResetToken', this.$route.query.userPasswordReset) + router.push({name: 'passwordReset'}) + } + }, created() { if (this.user.authenticated) { this.loadNamespaces() diff --git a/src/components/Home.vue b/src/components/Home.vue index 32acba07..0e28beff 100644 --- a/src/components/Home.vue +++ b/src/components/Home.vue @@ -18,7 +18,7 @@ }, beforeMount() { // Check if the user is already logged in, if so, redirect him to the homepage - if (!auth.user.authenticated) { + if (!auth.user.authenticated) { router.push({name: 'login'}) } }, diff --git a/src/components/user/Login.vue b/src/components/user/Login.vue index c51b5214..e7dd3596 100644 --- a/src/components/user/Login.vue +++ b/src/components/user/Login.vue @@ -1,33 +1,30 @@ @@ -72,4 +69,9 @@ .button { margin: 0 0.4em 0 0; } + + .reset-password-link{ + display: inline-block; + padding-top: 5px; + } diff --git a/src/components/user/PasswordReset.vue b/src/components/user/PasswordReset.vue new file mode 100644 index 00000000..c42a5ca7 --- /dev/null +++ b/src/components/user/PasswordReset.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/src/components/user/Register.vue b/src/components/user/Register.vue index e489aaff..8e69532a 100644 --- a/src/components/user/Register.vue +++ b/src/components/user/Register.vue @@ -1,46 +1,42 @@ diff --git a/src/components/user/RequestPasswordReset.vue b/src/components/user/RequestPasswordReset.vue new file mode 100644 index 00000000..038a52ae --- /dev/null +++ b/src/components/user/RequestPasswordReset.vue @@ -0,0 +1,73 @@ + + + + + diff --git a/src/router/index.js b/src/router/index.js index a95dc438..9b723c8b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -5,6 +5,8 @@ import HomeComponent from '@/components/Home' // User Handling import LoginComponent from '@/components/user/Login' import RegisterComponent from '@/components/user/Register' +import PasswordResetComponent from '@/components/user/PasswordReset' +import GetPasswordResetComponent from '@/components/user/RequestPasswordReset' // List Handling import ShowListComponent from '@/components/lists/ShowList' import NewListComponent from '@/components/lists/NewList' @@ -20,6 +22,7 @@ import NewTeamComponent from '@/components/teams/NewTeam' Vue.use(Router) export default new Router({ + mode:'history', routes: [ { path: '/', @@ -31,6 +34,16 @@ export default new Router({ name: 'login', component: LoginComponent }, + { + path: '/get-password-reset', + name: 'getPasswordReset', + component: GetPasswordResetComponent + }, + { + path: '/password-reset', + name: 'passwordReset', + component: PasswordResetComponent + }, { path: '/register', name: 'register', diff --git a/todo.md b/todo.md index bcfff01d..63545a6b 100644 --- a/todo.md +++ b/todo.md @@ -58,3 +58,7 @@ * [ ] Erklärungen zu was wie funktioniert -> wiki? * [ ] Google fonts raus (sollen von lokal geladen werden) * [ ] Ladeanimationen erst nach 100ms anzeigen, sonst wird das überflüssigerweise angezeigt + +* [ ] Userstuff + * [ ] Email-Verification + * [x] Password forgot \ No newline at end of file