feat: register pages routes guards.

feat: retrieve all organizations details to authenticated user.
feat: redux organization reducers and actions.
This commit is contained in:
Ahmed Bouhuolia
2020-10-11 00:08:51 +02:00
parent 8622320eef
commit 507690fedf
22 changed files with 348 additions and 66 deletions

View File

@@ -77,17 +77,12 @@ function RegisterUserForm({ requestRegister, requestLogin }) {
onSubmit: (values, { setSubmitting, setErrors }) => {
requestRegister(values)
.then((response) => {
// AppToaster.show({
// message: formatMessage({
// id: 'welcome_organization_account_has_been_created',
// }),
// intent: Intent.SUCCESS,
// });
requestLogin({
crediential: values.email,
password: values.password,
})
.then(() => {
history.push('/register/subscription');
setSubmitting(false);
})
.catch((errors) => {
@@ -98,7 +93,6 @@ function RegisterUserForm({ requestRegister, requestLogin }) {
intent: Intent.SUCCESS,
});
});
// history.push('/auth/login');
})
.catch((errors) => {
if (errors.some((e) => e.type === 'PHONE_NUMBER_EXISTS')) {