-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirebase.js
31 lines (28 loc) · 975 Bytes
/
firebase.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const firebase = require('firebase');
var config = {
apiKey: process.env.API_KEY,
authDomain: process.env.AUTH_DOMAIN,
databaseURL: process.env.DATABASE_URL,
projectId: process.env.PROJECT_ID,
storageBucket: process.env.STORAGE_BUCKET,
messagingSenderId: process.env.MESSAGING_SENDER_ID
};
firebase.initializeApp(config);
// module.exports.SignUpWithEmailAndPassword = (email, password) => {
// return firebase.auth().createUserWithEmailAndPassword(email, password)
// .then((user) => {
// return JSON.stringify(user)
// })
// .catch(function(error) {
// // Handle Errors here.
// var errorCode = error.code;
// var errorMessage = error.message;
// if (errorCode == 'auth/weak-password') {
// return {err: 'The password is too weak.'}
// } else {
// return {err: errorMessage }
// }
// return {err: error}
// });
// }
// return module.exports