diff options
author | Michael Foiani <mfoiani2019@communiyschoolnaples.org> | 2018-09-15 13:30:34 -0400 |
---|---|---|
committer | Michael Foiani <mfoiani2019@communiyschoolnaples.org> | 2018-09-15 13:30:34 -0400 |
commit | 0d6ea57b2b58111110f3a578b8ac7a14772d809b (patch) | |
tree | 447c6b0f64b881cee59a12c0c50ec8b3a080cdac /src/actions/firebaseAuth.js | |
parent | 7073f6545544277673c0806606834225907797d7 (diff) |
Created basic fix for new accounts to update username info when creatiing account.
Diffstat (limited to 'src/actions/firebaseAuth.js')
-rw-r--r-- | src/actions/firebaseAuth.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/actions/firebaseAuth.js b/src/actions/firebaseAuth.js index 37f6643..8f12c73 100644 --- a/src/actions/firebaseAuth.js +++ b/src/actions/firebaseAuth.js @@ -38,7 +38,7 @@ export const authSignOut = () => { export const createAccount = (_email, _password, divison) => (dispatch) => { auth.createUserWithEmailAndPassword(_email, _password).then(() => { - dispatch(signIn(_email, _password, divison)); + dispatch(setUserData(_email, _password, divison)); }) .catch((error) => { alert(error.code + ": " + error.message); @@ -53,10 +53,11 @@ import { import { adminListener, - adminClose + adminClose, + updateUserInfo } from './firebaseAdmin.js' -export const signIn = (_email, _password, divison) => (dispatch) => { +export const signIn = (_email, _password) => (dispatch) => { auth.signInWithEmailAndPassword(_email, _password).then(() => { var user = auth.currentUser; /* User is signed in. @@ -69,7 +70,6 @@ export const signIn = (_email, _password, divison) => (dispatch) => { var providerData = user.providerData; */ dispatch(authSuccess(user)); - if(divison) { dispatch(setUserData(divison)); } dispatch(fetchDivison()); dispatch(snapshotHours()) dispatch(snapshotRegisteredCompetitions()); |