Add a config option to whitelist users registration

Through whole email or domain email

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-12-17 12:09:24 +01:00
parent deed070b24
commit d552fcb2d3
19 changed files with 351 additions and 212 deletions

View File

@@ -29,7 +29,6 @@
</p>
<ul>
<li>{{ $t('Enjoy discovering Mobilizon!') }}</li>
<li>{{ $t("All data will be deleted every 48 hours, so please don't use this for anything real.") }}</li>
</ul>
<!-- <p>-->
<!-- {{ $t('Please read the full rules') }}-->
@@ -37,6 +36,7 @@
</div>
</div>
<div class="column">
<b-message type="is-warning" v-if="config.registrationsWhitelist">{{ $t('Registrations are restricted by whitelisting.') }}</b-message>
<form v-on:submit.prevent="submit()">
<b-field
:label="$t('Email')"
@@ -105,6 +105,8 @@
import { CREATE_USER } from '@/graphql/user';
import { Component, Prop, Vue } from 'vue-property-decorator';
import { RouteName } from '@/router';
import { IConfig } from '@/types/config.model';
import { CONFIG } from '@/graphql/config';
@Component({
metaInfo() {
@@ -115,6 +117,9 @@ import { RouteName } from '@/router';
titleTemplate: '%s | Mobilizon',
};
},
apollo: {
config: CONFIG,
},
})
export default class Register extends Vue {
@Prop({ type: String, required: false, default: '' }) email!: string;
@@ -129,6 +134,7 @@ export default class Register extends Vue {
sendingValidation: boolean = false;
validationSent: boolean = false;
RouteName = RouteName;
config!: IConfig;
async submit() {
this.credentials.locale = this.$i18n.locale;