diff options
author | Michael Foiani <mfoiani2019@communityschoolnaples.org> | 2018-09-15 21:43:51 +0000 |
---|---|---|
committer | Michael Foiani <mfoiani2019@communityschoolnaples.org> | 2018-09-15 21:43:51 +0000 |
commit | 5afa931ec2d48ed6aefafcb122b63be435e734ed (patch) | |
tree | 6054754d879d12ad6ffa996ca7ee478ba877ae91 /src/actions/firebaseAuth.js | |
parent | 0d6ea57b2b58111110f3a578b8ac7a14772d809b (diff) |
Revert "Created basic fix for new accounts to update username info when creatiing account."
This reverts commit 0d6ea57b2b58111110f3a578b8ac7a14772d809b
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 8f12c73..37f6643 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(setUserData(_email, _password, divison)); + dispatch(signIn(_email, _password, divison)); }) .catch((error) => { alert(error.code + ": " + error.message); @@ -53,11 +53,10 @@ import { import { adminListener, - adminClose, - updateUserInfo + adminClose } from './firebaseAdmin.js' -export const signIn = (_email, _password) => (dispatch) => { +export const signIn = (_email, _password, divison) => (dispatch) => { auth.signInWithEmailAndPassword(_email, _password).then(() => { var user = auth.currentUser; /* User is signed in. @@ -70,6 +69,7 @@ export const signIn = (_email, _password) => (dispatch) => { var providerData = user.providerData; */ dispatch(authSuccess(user)); + if(divison) { dispatch(setUserData(divison)); } dispatch(fetchDivison()); dispatch(snapshotHours()) dispatch(snapshotRegisteredCompetitions()); |