Redirect users to "awaiting approval" message on register #231

Merged
floatingghost merged 3 commits from registration-request-improvements into develop 2022-11-22 14:44:44 +00:00
6 changed files with 23 additions and 1 deletions
Showing only changes of commit ebc0d3c718 - Show all commits

View file

@ -23,6 +23,7 @@ import ListTimeline from 'components/list_timeline/list_timeline.vue'
import ListEdit from 'components/list_edit/list_edit.vue'
import AnnouncementsPage from 'components/announcements_page/announcements_page.vue'
import RegistrationRequestSent from 'components/registration_request_sent/registration_request_sent.vue'
import AwaitingEmailConfirmation from 'components/awaiting_email_confirmation/awaiting_email_confirmation.vue'
export default (store) => {
const validateAuthenticatedRoute = (to, from, next) => {
@ -64,6 +65,7 @@ export default (store) => {
{ name: 'dms', path: '/users/:username/dms', component: DMs, beforeEnter: validateAuthenticatedRoute },
{ name: 'registration', path: '/registration', component: Registration },
{ name: 'registration-request-sent', path: '/registration-request-sent', component: RegistrationRequestSent },
{ name: 'awaiting-email-confirmation', path: '/awaiting-email-confirmation', component: AwaitingEmailConfirmation },
{ name: 'password-reset', path: '/password-reset', component: PasswordReset, props: true },
{ name: 'registration-token', path: '/registration/:token', component: Registration },
{ name: 'friend-requests', path: '/friend-requests', component: FollowRequests, beforeEnter: validateAuthenticatedRoute },

View file

@ -0,0 +1,4 @@
export default {
computed: {
}
}

View file

@ -0,0 +1,12 @@
<template>
<div class="panel panel-default">
<div class="panel-heading">
<h4>{{ $t('registration.awaiting_email_confirmation_title') }}</h4>
</div>
<div class="panel-body">
<p>{{ $t('registration.awaiting_email_confirmation') }}</p>
</div>
</div>
</template>
<script src="./awaiting_email_confirmation.js"></script>

View file

@ -84,6 +84,8 @@ const registration = {
this.$router.push({ name: 'friends' })
} else if (data.identifier === 'awaiting_approval') {
this.$router.push({ name: 'registration-request-sent' })
} else if (data.identifier === 'missing_confirmed_email') {
this.$router.push({ name: 'awaiting-email-confirmation' })
} else {
console.warn('Unknown response from sign up', data)
}

View file

@ -409,6 +409,8 @@
}
},
"registration": {
"awaiting_email_confirmation_title": "Awaiting email confirmation",
"awaiting_email_confirmation": "Your account has been registered and an email has been sent to your address. Please check the email to complete registration.",
"bio": "Bio",
"bio_placeholder": "e.g.\nHi! Welcome to my bio.\nI love watching anime and playing games. I hope we can be friends!",
"captcha": "CAPTCHA",

View file

@ -489,7 +489,7 @@ const users = {
let data = await rootState.api.backendInteractor.register(
{ params: { ...userInfo } }
)
if (data.identifier === 'awaiting_approval') {
if (data.identifier === 'awaiting_approval' || data.identifier === 'missing_confirmed_email') {
store.commit('signUpSuccess')
return data
} else if (data.me !== undefined) {