diff options
| author | Michael Foiani <mfoiani2019@communiyschoolnaples.org> | 2018-08-04 23:50:16 -0400 |
|---|---|---|
| committer | Michael Foiani <mfoiani2019@communiyschoolnaples.org> | 2018-08-04 23:50:16 -0400 |
| commit | dd18707b172db1cdc5a69a0a39b5fff3c5edc781 (patch) | |
| tree | 73adbdff1a620573d3d6668bf617a1055e85a71e /src/reducers/firebaseAuth.js | |
| parent | 7a084f47ed17181af72629770cda3429af7656f7 (diff) | |
Formatted the firebaseAuth reducers and actions to be more organized.
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: |
