Merge pull request #266 from gradido/259-disable-register-flag

turn registration on and off
This commit is contained in:
Alexander Friedland 2021-04-29 12:56:02 +02:00 committed by GitHub
commit 42368ca546
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 7 deletions

View File

@ -1,2 +1,3 @@
LOGIN_API_URL=http://localhost/login_api/
COMMUNITY_API_URL=http://localhost/api/
ALLOW_REGISTER=true

View File

@ -2,11 +2,11 @@
// Load Package Details for some default values
// const pkg = require('../../package')
const environment = {
NODE_ENV: process.env.NODE_ENV,
DEBUG: process.env.NODE_ENV !== 'production' || false,
PRODUCTION: process.env.NODE_ENV === 'production' || false,
ALLOW_REGISTER: process.env.ALLOW_REGISTER !== 'false',
}
const server = {

View File

@ -1,6 +1,7 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './routes'
import CONFIG from '../config'
Vue.use(VueRouter)
@ -21,4 +22,11 @@ const router = new VueRouter({
},
})
if (CONFIG.ALLOW_REGISTER) {
router.addRoute({
path: '/register',
component: () => import('../views/Pages/Register.vue'),
})
}
export default router

View File

@ -50,10 +50,6 @@ const routes = [
path: '/thx',
component: () => import('../views/Pages/thx.vue'),
},
{
path: '/register',
component: () => import('../views/Pages/Register.vue'),
},
{
path: '/password',
component: () => import('../views/Pages/ForgotPassword.vue'),

View File

@ -82,7 +82,7 @@
{{ $t('site.login.forgot_pwd') }}
</router-link>
</b-col>
<b-col cols="6" class="text-right">
<b-col cols="6" class="text-right" v-show="allowRegister">
<router-link to="/register">
{{ $t('site.login.new_wallet') }}
</router-link>
@ -95,6 +95,7 @@
</template>
<script>
import loginAPI from '../../apis/loginAPI'
import CONFIG from '../../config'
export default {
name: 'login',
@ -106,6 +107,7 @@ export default {
// rememberMe: false
},
loginfail: false,
allowRegister: CONFIG.ALLOW_REGISTER,
}
},
methods: {