Show a dedicated registration notice page when further action is required after registering

This commit is contained in:
tusooa 2023-07-25 10:46:27 -04:00
commit 82c0044963
No known key found for this signature in database
GPG key ID: 42AEC43D48433C51
4 changed files with 40 additions and 6 deletions

View file

@ -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()