Merge branch 'invites' into 'develop'
FE part of invites system See merge request pleroma/pleroma-fe!297
This commit is contained in:
commit
ce88f351f7
5 changed files with 18 additions and 4 deletions
|
@ -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) {
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue