diff --git a/app/soapbox/features/landing_page/components/registration_form.js b/app/soapbox/features/auth_login/components/registration_form.js
similarity index 86%
rename from app/soapbox/features/landing_page/components/registration_form.js
rename to app/soapbox/features/auth_login/components/registration_form.js
index b0518c704..3ea8f6d62 100644
--- a/app/soapbox/features/landing_page/components/registration_form.js
+++ b/app/soapbox/features/auth_login/components/registration_form.js
@@ -45,11 +45,19 @@ export default @connect(mapStateToProps)
class RegistrationForm extends ImmutablePureComponent {
static propTypes = {
+ intl: PropTypes.object.isRequired,
instance: ImmutablePropTypes.map,
locale: PropTypes.string,
- intl: PropTypes.object.isRequired,
+ needsConfirmation: PropTypes.bool,
+ needsApproval: PropTypes.bool,
+ supportsEmailList: PropTypes.bool,
+ inviteToken: PropTypes.string,
}
+ static contextTypes = {
+ router: PropTypes.object,
+ };
+
state = {
captchaLoading: true,
submissionLoading: false,
@@ -94,17 +102,29 @@ 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('/');
+ });
}
}
onSubmit = e => {
- const { dispatch } = this.props;
- const params = this.state.params.set('locale', this.props.locale);
+ const { dispatch, inviteToken } = this.props;
+
+ const params = this.state.params.withMutations(params => {
+ // Locale for confirmation email
+ params.set('locale', this.props.locale);
+
+ // Pleroma invites
+ if (inviteToken) {
+ params.set('token', inviteToken);
+ }
+ });
this.setState({ submissionLoading: true });
@@ -140,40 +160,12 @@ class RegistrationForm extends ImmutablePureComponent {
render() {
const { instance, intl, supportsEmailList } = this.props;
const { params } = this.state;
- const isOpen = instance.get('registrations');
const isLoading = this.state.captchaLoading || this.state.submissionLoading;
- if (isOpen === false) {
- return (
-
-
-
-
-
- {instance.get('title')} }}
- />
-
-
- );
- }
-
return (
-