createUser(profile) { 
        return new Promise((resolve, reject) => {
            const newUser = new User({
                userId: profile.id,
                userName: profile.displayName,
                userAvatar: profile.photos[0].value || ""
            });
            newUser.save(error => {
                if(error) reject(error);
                else resolve(newUser);
            })
    });
}
// Create a new user and return it's instance
Create a new user and return it's instance
Create a new user and return it ' s instance
createUser(profile) { 
        return new Promise((resolve, reject) => {
            const newUser = new User({
                userId: profile.id,
                userName: profile.displayName,
                userAvatar: profile.photos[0].value || ""
            });
            newUser.save(error => {
                if(error) reject(error);
                else resolve(newUser);
            })
    });
}
createUser ( profile ) { return new Promise ( ( resolve , reject ) => { const newUser = new User ( { userId : profile . id , userName : profile . displayName , userAvatar : profile . photos [ 0 ] . value || "" } ) ; newUser . save ( error => { if ( error ) reject ( error ) ; else resolve ( newUser ) ; } ) } ) ; }
Create a new user and return it's instance
Create a new user and return it ' s instance