From 82c00449638a7aa06b63454f6dc5a44924a6d36e Mon Sep 17 00:00:00 2001 From: tusooa Date: Tue, 25 Jul 2023 10:46:27 -0400 Subject: Show a dedicated registration notice page when further action is required after registering --- src/components/registration/registration.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/components/registration/registration.js') diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js index b88bdeec..ca1fed94 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' }) + } else { + // display sign up notice, do not switch anywhere + } } catch (error) { console.warn('Registration failed: ', error) this.setCaptcha() -- cgit v1.2.3-70-g09d2 From 209c0a83325b9475b5ff9a4fd1ebede17d06ed63 Mon Sep 17 00:00:00 2001 From: tusooa Date: Sat, 13 Jan 2024 17:44:13 -0500 Subject: Remove empty else branch and detail the comments --- src/components/registration/registration.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/components/registration/registration.js') diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js index ca1fed94..78d31980 100644 --- a/src/components/registration/registration.js +++ b/src/components/registration/registration.js @@ -112,9 +112,9 @@ const registration = { const status = await this.signUp(this.user) if (status === 'ok') { this.$router.push({ name: 'friends' }) - } else { - // display sign up notice, do not switch anywhere } + // 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() -- cgit v1.2.3-70-g09d2