diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2019-07-10 03:47:07 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-07-10 03:47:07 +0900 |
| commit | a091cbb93aa4f204b2c8af6574b5b5c62eafd853 (patch) | |
| tree | 17ae059ea632ada7123325bc56fdc3232b6d6dd1 /src/client/app | |
| parent | Fix drive browser showing false empty (#5127) (diff) | |
| download | sharkey-a091cbb93aa4f204b2c8af6574b5b5c62eafd853.tar.gz sharkey-a091cbb93aa4f204b2c8af6574b5b5c62eafd853.tar.bz2 sharkey-a091cbb93aa4f204b2c8af6574b5b5c62eafd853.zip | |
Prevent duplicate user registration (#5129)
Diffstat (limited to 'src/client/app')
| -rw-r--r-- | src/client/app/common/views/components/signup.vue | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/app/common/views/components/signup.vue b/src/client/app/common/views/components/signup.vue index 421d09a4dd..893f6575fb 100644 --- a/src/client/app/common/views/components/signup.vue +++ b/src/client/app/common/views/components/signup.vue @@ -43,7 +43,7 @@ </i18n> </ui-switch> <div v-if="meta.enableRecaptcha" class="g-recaptcha" :data-sitekey="meta.recaptchaSiteKey" style="margin: 16px 0;"></div> - <ui-button type="submit" :disabled="!(meta.ToSUrl ? ToSAgreement : true) || passwordRetypeState == 'not-match'">{{ $t('create') }}</ui-button> + <ui-button type="submit" :disabled=" submitting || !(meta.ToSUrl ? ToSAgreement : true) || passwordRetypeState == 'not-match'">{{ $t('create') }}</ui-button> </template> </form> </template> @@ -70,6 +70,7 @@ export default Vue.extend({ passwordStrength: '', passwordRetypeState: null, meta: {}, + submitting: false, ToSAgreement: false } }, @@ -145,6 +146,9 @@ export default Vue.extend({ }, onSubmit() { + if (this.submitting) return; + this.submitting = true; + this.$root.api('signup', { username: this.username, password: this.password, @@ -159,6 +163,8 @@ export default Vue.extend({ location.href = '/'; }); }).catch(() => { + this.submitting = false; + this.$root.dialog({ type: 'error', text: this.$t('some-error') |