diff --git a/client/coral-framework/constants/auth.js b/client/coral-framework/constants/auth.js
index f590fce12..c48894cc5 100644
--- a/client/coral-framework/constants/auth.js
+++ b/client/coral-framework/constants/auth.js
@@ -1,14 +1,21 @@
-export const USER_LOGIN_REQUEST = 'USER_LOGIN_REQUEST';
-export const USER_LOGIN_SUCCESS = 'USER_LOGIN_SUCCESS';
-export const USER_LOGIN_FAILURE = 'USER_LOGIN_FAILURE';
-export const USER_FACEBOOK_LOGIN_REQUEST = 'USER_FACEBOOK_LOGIN_REQUEST';
-export const USER_FACEBOOK_SUCCESS = 'USER_FACEBOOK_SUCCESS';
-export const USER_FACEBOOK_FAILURE = 'USER_FACEBOOK_FAILURE';
-export const USER_LOGOUT_REQUEST = 'USER_LOGOUT_REQUEST';
-export const USER_LOGOUT_SUCCESS = 'USER_LOGOUT_SUCCESS';
-export const USER_LOGOUT_FAILURE = 'USER_LOGOUT_FAILURE';
+export const CHANGE_VIEW = 'CHANGE_VIEW';
+export const CLEAN_STATE = 'CLEAN_STATE';
export const SHOW_SIGNIN_DIALOG = 'SHOW_SIGNIN_DIALOG';
export const HIDE_SIGNIN_DIALOG = 'HIDE_SIGNIN_DIALOG';
-export const CHANGE_VIEW = 'CHANGE_VIEW';
+export const FETCH_SIGNUP_REQUEST = 'FETCH_SIGNUP_REQUEST';
+export const FETCH_SIGNUP_FAILURE = 'FETCH_SIGNUP_FAILURE';
+export const FETCH_SIGNUP_SUCCESS = 'FETCH_SIGNUP_SUCCESS';
+
+export const FETCH_SIGNIN_REQUEST = 'FETCH_SIGNIN_REQUEST';
+export const FETCH_SIGNIN_FAILURE = 'FETCH_SIGNIN_FAILURE';
+export const FETCH_SIGNIN_SUCCESS = 'FETCH_SIGNIN_SUCCESS';
+
+export const FETCH_SIGNIN_FACEBOOK_REQUEST = 'FETCH_SIGNIN_FACEBOOK_REQUEST';
+export const FETCH_SIGNIN_FACEBOOK_FAILURE = 'FETCH_SIGNIN_FACEBOOK_FAILURE';
+export const FETCH_SIGNIN_FACEBOOK_SUCCESS = 'FETCH_SIGNIN_FACEBOOK_SUCCESS';
+
+export const FETCH_FORGOT_PASSWORD_REQUEST = 'FETCH_FORGOT_PASSWORD_REQUEST';
+export const FETCH_FORGOT_PASSWORD_SUCCESS = 'FETCH_FORGOT_PASSWORD_SUCCESS';
+export const FETCH_FORGOT_PASSWORD_FAILURE = 'FETCH_FORGOT_PASSWORD_FAILURE';
diff --git a/client/coral-framework/helpers/error.js b/client/coral-framework/helpers/error.js
index 6ae79a996..2674bc55b 100644
--- a/client/coral-framework/helpers/error.js
+++ b/client/coral-framework/helpers/error.js
@@ -1,4 +1,6 @@
export default {
email: 'Not a valid E-Mail',
- password: 'Password must be at least 8 characters'
+ password: 'Password must be at least 8 characters',
+ username: 'Username is too short',
+ confirmPassword: 'Passwords do not match'
};
diff --git a/client/coral-framework/helpers/validate.js b/client/coral-framework/helpers/validate.js
index e69de29bb..9fda4b1c2 100644
--- a/client/coral-framework/helpers/validate.js
+++ b/client/coral-framework/helpers/validate.js
@@ -0,0 +1,6 @@
+export default {
+ email: email => (/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(email)),
+ password: pass => (/^(?=.{8,}).*$/.test(pass)),
+ confirmPassword: () => true,
+ username: username => (/^(?=.{3,}).*$/.test(username))
+};
diff --git a/client/coral-framework/reducers/auth.js b/client/coral-framework/reducers/auth.js
index 1cc67d192..5e54d70b6 100644
--- a/client/coral-framework/reducers/auth.js
+++ b/client/coral-framework/reducers/auth.js
@@ -3,11 +3,16 @@ import {Map} from 'immutable';
import {
SHOW_SIGNIN_DIALOG,
HIDE_SIGNIN_DIALOG,
- CHANGE_VIEW
+ CHANGE_VIEW,
+ CLEAN_STATE,
+ FETCH_SIGNIN_REQUEST,
+ FETCH_SIGNIN_FAILURE,
+ FETCH_SIGNIN_SUCCESS
} from '../constants/auth';
const initialState = Map({
auth: Map(),
+ isLoading: false,
loggedIn: false,
error: '',
user: {},
@@ -15,17 +20,29 @@ const initialState = Map({
view: 'SIGNIN'
});
-export default function community (state = initialState, action) {
+export const getEmail = state => state.auth.formData.email;
+
+export default function auth (state = initialState, action) {
switch (action.type) {
case SHOW_SIGNIN_DIALOG :
return state
.set('showSignInDialog', true);
case HIDE_SIGNIN_DIALOG :
- return state
- .set('showSignInDialog', false);
+ return initialState;
case CHANGE_VIEW :
return state
.set('view', action.view);
+ case CLEAN_STATE:
+ return initialState;
+ case FETCH_SIGNIN_REQUEST:
+ return state
+ .set('isLoading', true);
+ case FETCH_SIGNIN_FAILURE:
+ return state
+ .set('isLoading', false);
+ case FETCH_SIGNIN_SUCCESS:
+ return state
+ .set('isLoading', false);
default :
return state;
}
diff --git a/client/coral-sign-in/components/Alert.js b/client/coral-sign-in/components/Alert.js
index e69de29bb..019c3456a 100644
--- a/client/coral-sign-in/components/Alert.js
+++ b/client/coral-sign-in/components/Alert.js
@@ -0,0 +1,13 @@
+import React from 'react';
+import styles from './styles.css';
+
+const Alert = ({cStyle = 'error', children, className, ...props}) => (
+
+ {children}
+
+);
+
+export default Alert;
diff --git a/client/coral-sign-in/components/ForgotContent.js b/client/coral-sign-in/components/ForgotContent.js
index 9f32f6933..7214d2bb6 100644
--- a/client/coral-sign-in/components/ForgotContent.js
+++ b/client/coral-sign-in/components/ForgotContent.js
@@ -1,21 +1,21 @@
import React from 'react';
import styles from './styles.css';
-import Button from './Button';
+import Button from 'coral-ui/components/Button';
import I18n from 'coral-framework/modules/i18n/i18n';
import translations from '../translations';
const lang = new I18n(translations);
-const ForgotContent = ({changeView}) => (
+const ForgotContent = ({changeView, ...props}) => (
{lang.t('signIn.recoverPassword')}
-
diff --git a/client/coral-sign-in/components/FormField.js b/client/coral-sign-in/components/FormField.js
index e69de29bb..62e50e637 100644
--- a/client/coral-sign-in/components/FormField.js
+++ b/client/coral-sign-in/components/FormField.js
@@ -0,0 +1,18 @@
+import React from 'react';
+import styles from './styles.css';
+
+const FormField = ({className, showErrors = false, errorMsg, label, ...props}) => (
+
+
+
+ {showErrors && errorMsg && {errorMsg}}
+
+);
+
+export default FormField;
diff --git a/client/coral-sign-in/components/SignDialog.js b/client/coral-sign-in/components/SignDialog.js
index e5c6f0ea4..242b7443a 100644
--- a/client/coral-sign-in/components/SignDialog.js
+++ b/client/coral-sign-in/components/SignDialog.js
@@ -6,9 +6,9 @@ import SignInContent from './SignInContent';
import SingUpContent from './SignUpContent';
import ForgotContent from './ForgotContent';
-const SignDialog = ({open, view, onClose, ...props}) => (
+const SignDialog = ({open, view, handleClose, ...props}) => (