diff options
| author | marcin mikołajczak <git@mkljczk.pl> | 2024-01-19 19:01:38 +0100 |
|---|---|---|
| committer | marcin mikołajczak <git@mkljczk.pl> | 2024-01-19 19:01:38 +0100 |
| commit | d28e48e9dcf163e4493bcfc3c65ec62a0b740c38 (patch) | |
| tree | e3cf789de6e010f653bf821db85465f01e4692eb /src/components/registration/registration.js | |
| parent | f6d3a66a5b7bcbbecc72a66532866ee096c7752d (diff) | |
| parent | dbe9da0f09d9471e9a87e564bb18412f937b8542 (diff) | |
Merge remote-tracking branch 'mkljczk/quotes-count' into quotes-count
Diffstat (limited to 'src/components/registration/registration.js')
| -rw-r--r-- | src/components/registration/registration.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js index b88bdeec..78d31980 100644 --- a/src/components/registration/registration.js +++ b/src/components/registration/registration.js @@ -83,6 +83,8 @@ const registration = { signedIn: (state) => !!state.users.currentUser, isPending: (state) => state.users.signUpPending, serverValidationErrors: (state) => state.users.signUpErrors, + signUpNotice: (state) => state.users.signUpNotice, + hasSignUpNotice: (state) => !!state.users.signUpNotice.message, termsOfService: (state) => state.instance.tos, accountActivationRequired: (state) => state.instance.accountActivationRequired, accountApprovalRequired: (state) => state.instance.accountApprovalRequired, @@ -107,8 +109,12 @@ const registration = { if (!this.v$.$invalid) { try { - await this.signUp(this.user) - this.$router.push({ name: 'friends' }) + const status = await this.signUp(this.user) + if (status === 'ok') { + this.$router.push({ name: 'friends' }) + } + // If status is not 'ok' (i.e. it needs further actions to be done + // before you can login), display sign up notice, do not switch anywhere } catch (error) { console.warn('Registration failed: ', error) this.setCaptcha() |
