diff --git a/changelog.d/registration-notice.add b/changelog.d/registration-notice.add new file mode 100644 index 0000000000..b2777ba2de --- /dev/null +++ b/changelog.d/registration-notice.add @@ -0,0 +1 @@ +Show a dedicated registration notice page when further action is required after registering diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js index b88bdeecb2..78d319804c 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() diff --git a/src/components/registration/registration.vue b/src/components/registration/registration.vue index 7438a5f4d7..5c913f94c2 100644 --- a/src/components/registration/registration.vue +++ b/src/components/registration/registration.vue @@ -3,7 +3,10 @@
+ {{ signUpNotice.message }} +
+