diff options
| author | lambda <pleromagit@rogerbraun.net> | 2018-08-12 16:15:27 +0000 |
|---|---|---|
| committer | lambda <pleromagit@rogerbraun.net> | 2018-08-12 16:15:27 +0000 |
| commit | ce88f351f7b28a36553e67f7e02373be7b51ef8f (patch) | |
| tree | b8b24ff54e792eb68498eb59c5a6c73508f615e5 /src/components | |
| parent | 25be51e2c1d9ca7ab112682c59ffadd6d1b63276 (diff) | |
| parent | 9cebb00faa9107f93d038bf3550a3ad1d61be9bf (diff) | |
Merge branch 'invites' into 'develop'
FE part of invites system
See merge request pleroma/pleroma-fe!297
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/registration/registration.js | 10 | ||||
| -rw-r--r-- | src/components/registration/registration.vue | 4 |
2 files changed, 12 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) { diff --git a/src/components/registration/registration.vue b/src/components/registration/registration.vue index 00f665af..087cab6b 100644 --- a/src/components/registration/registration.vue +++ b/src/components/registration/registration.vue @@ -38,6 +38,10 @@ <input :disabled="registering" v-model='user.captcha' placeholder='Enter captcha' type='test' class='form-control' id='captcha'> </div> --> + <div class='form-group' v-if='token' > + <label for='token'>{{$t('registration.token')}}</label> + <input disabled='true' v-model='token' class='form-control' id='token' type='text'> + </div> <div class='form-group'> <button :disabled="registering" type='submit' class='btn btn-default'>{{$t('general.submit')}}</button> </div> |
