Initial git

This commit is contained in:
Qolzam
2017-07-06 11:20:18 +04:30
commit 7c691d8e4d
142 changed files with 13046 additions and 0 deletions

29
app/helpers/index.jsx Normal file
View File

@@ -0,0 +1,29 @@
import {firebaseAuth, firebaseRef} from 'app/firebase/'
export function auth(email, pw, other) {
return firebaseAuth().createUserWithEmailAndPassword(email, pw)
.then(u => saveUser(u,other))
}
export function logout() {
return firebaseAuth().signOut()
}
export function login(email, pw) {
return firebaseAuth().signInWithEmailAndPassword(email, pw)
}
export function resetPassword(email) {
return firebaseAuth().sendPasswordResetEmail(email)
}
export function saveUser(user,other) {
return firebaseRef.child(`users/${user.uid}/info`)
.set({
...other,
email: user.email,
uid: user.uid
})
.then(() => user)
}