Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const auth = firebase.auth();
- const db = firebase.firestore();
- // sign up the user
- auth.createUserWithEmailAndPassword(email, password).then((cred) => {
- // set admin to true for the only first user
- return db.collection('users').doc(cred.user.uid).set({
- admin: true
- })
- }).then(() => {
- console.log();
- }).catch(err => {
- });
- const auth = firebase.auth();
- const db = firebase.firestore();
- // sign up the user
- auth.createUserWithEmailAndPassword(email, password).then((cred) => {
- // set admin to true for the only first user
- return db.collection('users').doc(cred.user.uid).set({
- admin: true
- })
- }).then(() => {
- console.log();
- }).catch(err => {
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement