Add a config.json option for enabling registration, don't link and redirect away from register page when it's disabled.
This commit is contained in:
parent
bfbc94d697
commit
1a5ee95ee4
5 changed files with 12 additions and 4 deletions
|
@ -4,7 +4,8 @@ const LoginForm = {
|
|||
authError: false
|
||||
}),
|
||||
computed: {
|
||||
loggingIn () { return this.$store.state.users.loggingIn }
|
||||
loggingIn () { return this.$store.state.users.loggingIn },
|
||||
registrationOpen () { return this.$store.state.config.registrationOpen }
|
||||
},
|
||||
methods: {
|
||||
submit () {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
</div>
|
||||
<div class='form-group'>
|
||||
<div class='login-bottom'>
|
||||
<div><router-link :to="{name: 'registration'}" class='register'>Register</router-link></div>
|
||||
<div><router-link :to="{name: 'registration'}" v-if='registrationOpen' class='register'>Register</router-link></div>
|
||||
<button :disabled="loggingIn" type='submit' class='btn btn-default base05 base01-background'>Log in</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -4,6 +4,11 @@ const registration = {
|
|||
error: false,
|
||||
registering: false
|
||||
}),
|
||||
created () {
|
||||
if (!this.$store.state.config.registrationOpen || !!this.$store.state.users.currentUser) {
|
||||
this.$router.push('/main/all')
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
termsofservice () { return this.$store.state.config.tos }
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue