aboutsummaryrefslogtreecommitdiff
path: root/src/components/registration/registration.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2018-08-05 10:01:38 +0300
committerHenry Jameson <me@hjkos.com>2018-08-05 10:01:38 +0300
commit9cebb00faa9107f93d038bf3550a3ad1d61be9bf (patch)
tree6468c692d2862628192121c58fecc2f1ef64d8f1 /src/components/registration/registration.js
parent32fd108e97de8a1e1201bcc31f70af9ace77e517 (diff)
the missing piece for invites system
Diffstat (limited to 'src/components/registration/registration.js')
-rw-r--r--src/components/registration/registration.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js
index 771b3b27..73840608 100644
--- a/src/components/registration/registration.js
+++ b/src/components/registration/registration.js
@@ -5,17 +5,23 @@ const registration = {
registering: false
}),
created () {
- if (!this.$store.state.config.registrationOpen || !!this.$store.state.users.currentUser) {
+ if ((!this.$store.state.config.registrationOpen && !this.token) || !!this.$store.state.users.currentUser) {
this.$router.push('/main/all')
}
+ // Seems like this doesn't work at first page open for some reason
+ if (this.$store.state.config.registrationOpen && this.token) {
+ this.$router.push('/registration')
+ }
},
computed: {
- termsofservice () { return this.$store.state.config.tos }
+ termsofservice () { return this.$store.state.config.tos },
+ token () { return this.$route.params.token }
},
methods: {
submit () {
this.registering = true
this.user.nickname = this.user.username
+ this.user.token = this.token
this.$store.state.api.backendInteractor.register(this.user).then(
(response) => {
if (response.ok) {