diff --git a/app/soapbox/features/auth_login/components/registration_form.js b/app/soapbox/features/auth_login/components/registration_form.js index 704ce4840..3ea8f6d62 100644 --- a/app/soapbox/features/auth_login/components/registration_form.js +++ b/app/soapbox/features/auth_login/components/registration_form.js @@ -54,6 +54,10 @@ class RegistrationForm extends ImmutablePureComponent { inviteToken: PropTypes.string, } + static contextTypes = { + router: PropTypes.object, + }; + state = { captchaLoading: true, submissionLoading: false, @@ -98,11 +102,14 @@ class RegistrationForm extends ImmutablePureComponent { postRegisterAction = ({ access_token }) => { const { dispatch, needsConfirmation, needsApproval } = this.props; + const { router } = this.context; if (needsConfirmation || needsApproval) { return this.launchModal(); } else { - return dispatch(verifyCredentials(access_token)); + return dispatch(verifyCredentials(access_token)).then(() => { + router.history.push('/'); + }); } }