aboutsummaryrefslogtreecommitdiff
path: root/src/components/registration/registration.js
diff options
context:
space:
mode:
authormarcin mikołajczak <me@mkljczk.pl>2024-01-14 06:23:30 +0000
committermarcin mikołajczak <me@mkljczk.pl>2024-01-14 06:23:30 +0000
commitdbe9da0f09d9471e9a87e564bb18412f937b8542 (patch)
tree9e628be15bda940c59131da1d56024ba22cf7973 /src/components/registration/registration.js
parent6c4c8fe51f0e2c4ce55f5915a2bc5434aef5e5e7 (diff)
parentae4e360157234a352f71c90e84b9861ee572472e (diff)
Merge branch 'develop' into 'quotes-count'
# Conflicts: # src/services/api/api.service.js
Diffstat (limited to 'src/components/registration/registration.js')
-rw-r--r--src/components/registration/registration.js10
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()