aboutsummaryrefslogtreecommitdiff
path: root/src/components/registration/registration.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2024-02-29 18:49:23 +0200
committerHenry Jameson <me@hjkos.com>2024-02-29 18:49:23 +0200
commit54e3a99bc762a1286b0c1a782297d40587b7f14f (patch)
treed4f08471c797c673977b330f358c004094a87c32 /src/components/registration/registration.js
parent73f6ecb21e9a705caac0d1ce6b38b3aa75e4345b (diff)
parent90427921336879bd7b5df742a7af41d85dceeee4 (diff)
Merge remote-tracking branch 'origin/develop' into themes3
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()