diff options
Diffstat (limited to 'src/reducers/firebaseAuth.js')
-rw-r--r-- | src/reducers/firebaseAuth.js | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/reducers/firebaseAuth.js b/src/reducers/firebaseAuth.js index ced6c1c..37b5cf6 100644 --- a/src/reducers/firebaseAuth.js +++ b/src/reducers/firebaseAuth.js @@ -10,8 +10,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN import { AUTH_SUCCESS, - AUTH_SIGN_OUT, - UPDATE_ADMIN + AUTH_FAIL, + AUTH_SIGN_OUT } from '../actions/firebaseAuth.js'; @@ -19,7 +19,14 @@ const firebaseAuth = (state = {signedIn: false, uid: "", userEmail: ""}, action) switch (action.type) { case AUTH_SUCCESS: return { - ...state, + signedIn: action.payload, + uid: action.uid, + userEmail: action.userEmail + }; + break; + + case AUTH_FAIL: + return { signedIn: action.payload, uid: action.uid, userEmail: action.userEmail @@ -28,9 +35,10 @@ const firebaseAuth = (state = {signedIn: false, uid: "", userEmail: ""}, action) case AUTH_SIGN_OUT: return { - ...state, - signedIn: action.payload - } + signedIn: action.payload, + uid: action.uid, + userEmail: action.userEmail + }; break; default: |