Advertisement
Gabsness

Helper Auth

Aug 31st, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { firebaseAuth, ref } from '../../data/config'
  2.  
  3. const saveUser = (user) => (
  4.     ref
  5.         .child()
  6.         .set({})
  7.         .then( () => {} )
  8. )
  9.  
  10. const auth = (email,password) => (
  11.     firebaseAuth()
  12.     .createUserWithEmailAndPassword(email,password)
  13.         .then(saveUser)
  14. )
  15.  
  16. const login = (email,password) => firebaseAuth().signInWithEmailAndPassword(email,password)
  17.  
  18. const logout = () => firebaseAuth().signOut()
  19.  
  20. const resetPassword = email => firebaseAuth().sendPasswordResetEmail(email)
  21.  
  22. export {
  23.     saveUser,
  24.     auth,
  25.     login,
  26.     logout,
  27.     resetPassword
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement