Email Login
This commit is contained in:
		@@ -15,7 +15,9 @@ app.set('view engine', 'ejs');
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
app.use(logger('dev'));
 | 
					app.use(logger('dev'));
 | 
				
			||||||
app.use(express.json());
 | 
					app.use(express.json());
 | 
				
			||||||
app.use(express.urlencoded({ extended: false }));
 | 
					app.use(express.urlencoded({
 | 
				
			||||||
 | 
					  extended: false
 | 
				
			||||||
 | 
					}));
 | 
				
			||||||
app.use(express.static(path.join(__dirname, 'public')));
 | 
					app.use(express.static(path.join(__dirname, 'public')));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
app.use('/', indexRouter);
 | 
					app.use('/', indexRouter);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,9 @@
 | 
				
			|||||||
const { Client } = require ("pg");
 | 
					const {
 | 
				
			||||||
const {postgresSQL} = require("./keys")
 | 
					    Client
 | 
				
			||||||
 | 
					} = require("pg");
 | 
				
			||||||
 | 
					const {
 | 
				
			||||||
 | 
					    postgresSQL
 | 
				
			||||||
 | 
					} = require("./keys")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const client = new Client(postgresSQL);
 | 
					const client = new Client(postgresSQL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -7,27 +11,21 @@ async function connect() {
 | 
				
			|||||||
    try {
 | 
					    try {
 | 
				
			||||||
        await client.connect();
 | 
					        await client.connect();
 | 
				
			||||||
        console.log("Database connected!");
 | 
					        console.log("Database connected!");
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
    catch(error)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        console.error(error)
 | 
					        console.error(error)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
connect();
 | 
					connect();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async function query(queryString,param)
 | 
					async function query(queryString, param) {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
        let result = await client.query(queryString, param);
 | 
					        let result = await client.query(queryString, param);
 | 
				
			||||||
        let resultarray = [];
 | 
					        let resultarray = [];
 | 
				
			||||||
    for(let row of result.rows)
 | 
					        for (let row of result.rows) {
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
            resultarray.push(row.obj);
 | 
					            resultarray.push(row.obj);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return resultarray;
 | 
					        return resultarray;
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
    catch(error)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        console.log(error)
 | 
					        console.log(error)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -41,5 +39,6 @@ async function nonQuery(queryString,param) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module.exports = {
 | 
					module.exports = {
 | 
				
			||||||
    query, nonQuery
 | 
					    query,
 | 
				
			||||||
 | 
					    nonQuery
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -1,4 +1,7 @@
 | 
				
			|||||||
const { query, nonQuery } = require("../db-config/postgresql-common");
 | 
					const {
 | 
				
			||||||
 | 
					    query,
 | 
				
			||||||
 | 
					    nonQuery
 | 
				
			||||||
 | 
					} = require("../db-config/postgresql-common");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const stringSimilarity = require('string-similarity');
 | 
					const stringSimilarity = require('string-similarity');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -10,9 +13,7 @@ async function updateUser(uid, mid, name, picture, email) {
 | 
				
			|||||||
    try {
 | 
					    try {
 | 
				
			||||||
        await nonQuery('INSERT INTO "User" (username, message_id, name, picture, email) VALUES ($1, $2, $3, $4, $5);', [uid, mid, name, picture, email]);
 | 
					        await nonQuery('INSERT INTO "User" (username, message_id, name, picture, email) VALUES ($1, $2, $3, $4, $5);', [uid, mid, name, picture, email]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch (error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -23,9 +24,7 @@ async function getmessageids(sl_id) {
 | 
				
			|||||||
        let admin = query('SELECT * FROM "Shoppinglist_admin" WHERE sl_id = $1;', [sl_id]);
 | 
					        let admin = query('SELECT * FROM "Shoppinglist_admin" WHERE sl_id = $1;', [sl_id]);
 | 
				
			||||||
        return users_to_array(admin, members);
 | 
					        return users_to_array(admin, members);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch(error) {
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -35,10 +34,10 @@ async function getmessageids(sl_id) {
 | 
				
			|||||||
async function searchUsers(searchstring) {
 | 
					async function searchUsers(searchstring) {
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
        let users = await query('SELECT row_to_json("User") AS obj FROM "User";');
 | 
					        let users = await query('SELECT row_to_json("User") AS obj FROM "User";');
 | 
				
			||||||
        return users.filter(function(obj) {return obj.name.toUpperCase().includes(searchstring.toUpperCase())});
 | 
					        return users.filter(function (obj) {
 | 
				
			||||||
    }
 | 
					            return obj.name.toUpperCase().includes(searchstring.toUpperCase())
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
    catch(error) {
 | 
					    } catch (error) {
 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -54,9 +53,7 @@ async function getShoppinglistsAdmin(username) {
 | 
				
			|||||||
        username = $1', [username]);
 | 
					        username = $1', [username]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return result;
 | 
					        return result;
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch (error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -67,9 +64,7 @@ async function getShoppinglistsByLink(link) {
 | 
				
			|||||||
        console.log("PPPPP LIIINK:", link)
 | 
					        console.log("PPPPP LIIINK:", link)
 | 
				
			||||||
        let result = await query('SELECT row_to_json("Shoppinglist") AS obj FROM "Shoppinglist" WHERE invitelink = $1', [link]);
 | 
					        let result = await query('SELECT row_to_json("Shoppinglist") AS obj FROM "Shoppinglist" WHERE invitelink = $1', [link]);
 | 
				
			||||||
        return result;
 | 
					        return result;
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch (error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -81,9 +76,7 @@ async function getShoppinglistsShared(username) {
 | 
				
			|||||||
        let result = await query('SELECT row_to_json("Shoppinglist") AS obj FROM "Shoppinglist" JOIN "Shoppinglist_member" USING (sl_id) WHERE username = $1;', [username]);
 | 
					        let result = await query('SELECT row_to_json("Shoppinglist") AS obj FROM "Shoppinglist" JOIN "Shoppinglist_member" USING (sl_id) WHERE username = $1;', [username]);
 | 
				
			||||||
        console.log(result);
 | 
					        console.log(result);
 | 
				
			||||||
        return result;
 | 
					        return result;
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch (error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -100,27 +93,21 @@ async function newShoppinglist(name, description, username, color) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
        await nonQuery('INSERT INTO "User" (username) VALUES ($1);', [username]);
 | 
					        await nonQuery('INSERT INTO "User" (username) VALUES ($1);', [username]);
 | 
				
			||||||
    } 
 | 
					    } catch (error) {
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    catch (error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //insert shoppinglist
 | 
					    //insert shoppinglist
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
        await nonQuery('INSERT INTO "Shoppinglist" (sl_id, name, description, color) VALUES ($1, $2, $3, $4);', [sl_id, name, description, color]);
 | 
					        await nonQuery('INSERT INTO "Shoppinglist" (sl_id, name, description, color) VALUES ($1, $2, $3, $4);', [sl_id, name, description, color]);
 | 
				
			||||||
    } 
 | 
					    } catch (error) {
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    catch (error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //insert admin
 | 
					    //insert admin
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
        await nonQuery('INSERT INTO "Shoppinglist_admin" (username, sl_id) VALUES ($1, $2);', [username, sl_id]);
 | 
					        await nonQuery('INSERT INTO "Shoppinglist_admin" (username, sl_id) VALUES ($1, $2);', [username, sl_id]);
 | 
				
			||||||
    }  
 | 
					    } catch (error) {
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    catch (error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -143,9 +130,7 @@ async function editShoppinglist(sl_id, newname, newdescription, newcolor) {
 | 
				
			|||||||
        if (shoppinglist.color != newcolor && newcolor != undefined) {
 | 
					        if (shoppinglist.color != newcolor && newcolor != undefined) {
 | 
				
			||||||
            await nonQuery('UPDATE "Shoppinglist" SET color = $1 WHERE sl_id = $2;', [newcolor, sl_id]);
 | 
					            await nonQuery('UPDATE "Shoppinglist" SET color = $1 WHERE sl_id = $2;', [newcolor, sl_id]);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch (error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -173,9 +158,7 @@ async function displayShoppinglist(sl_id) {
 | 
				
			|||||||
        let admin = await query('SELECT row_to_json("User") as obj FROM "User" JOIN "Shoppinglist_admin" USING (username) WHERE sl_id = $1', [sl_id]);
 | 
					        let admin = await query('SELECT row_to_json("User") as obj FROM "User" JOIN "Shoppinglist_admin" USING (username) WHERE sl_id = $1', [sl_id]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return items_in_groups(groups, items, sl_id, admin[0].username, admin[0].message_id, members, shoppinglist[0].name, shoppinglist[0].description);
 | 
					        return items_in_groups(groups, items, sl_id, admin[0].username, admin[0].message_id, members, shoppinglist[0].name, shoppinglist[0].description);
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch (error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -188,9 +171,7 @@ async function deleteShoppinglist(sl_id) {
 | 
				
			|||||||
        await nonQuery('DELETE FROM "Shoppinglist_admin" WHERE sl_id = $1', [sl_id]);
 | 
					        await nonQuery('DELETE FROM "Shoppinglist_admin" WHERE sl_id = $1', [sl_id]);
 | 
				
			||||||
        await nonQuery('DELETE FROM "Shoppinglist_member" WHERE sl_id = $1', [sl_id]);
 | 
					        await nonQuery('DELETE FROM "Shoppinglist_member" WHERE sl_id = $1', [sl_id]);
 | 
				
			||||||
        await nonQuery('DELETE FROM "Shoppinglist" WHERE sl_id = $1', [sl_id]);
 | 
					        await nonQuery('DELETE FROM "Shoppinglist" WHERE sl_id = $1', [sl_id]);
 | 
				
			||||||
    } 
 | 
					    } catch (error) {
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    catch (error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -201,9 +182,7 @@ async function addGroup(sl_id, name, color, hidden) {
 | 
				
			|||||||
    try {
 | 
					    try {
 | 
				
			||||||
        let grid = generate_group_id();
 | 
					        let grid = generate_group_id();
 | 
				
			||||||
        await nonQuery('INSERT INTO "Group" (group_id, sl_id, name, color, hidden) VALUES ($1, $2, $3, $4, $5);', [grid, sl_id, name, color, hidden]);
 | 
					        await nonQuery('INSERT INTO "Group" (group_id, sl_id, name, color, hidden) VALUES ($1, $2, $3, $4, $5);', [grid, sl_id, name, color, hidden]);
 | 
				
			||||||
    } 
 | 
					    } catch (error) {
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    catch (error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -214,9 +193,7 @@ async function addItem(group_id, sl_id, name, count) {
 | 
				
			|||||||
    try {
 | 
					    try {
 | 
				
			||||||
        let itid = generate_item_id();
 | 
					        let itid = generate_item_id();
 | 
				
			||||||
        await nonQuery('INSERT INTO "Item" VALUES ($1, $2, $3, $4, $5);', [itid, group_id, sl_id, name, count]);
 | 
					        await nonQuery('INSERT INTO "Item" VALUES ($1, $2, $3, $4, $5);', [itid, group_id, sl_id, name, count]);
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch (error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -238,9 +215,7 @@ async function editGroup(sl_id, group_id, name, color, hidden) {
 | 
				
			|||||||
            await nonQuery('UPDATE "Group" SET hidden = $1 WHERE group_id = $2 AND sl_id = $3;', [hidden, group_id, sl_id]);
 | 
					            await nonQuery('UPDATE "Group" SET hidden = $1 WHERE group_id = $2 AND sl_id = $3;', [hidden, group_id, sl_id]);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch (error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -259,9 +234,7 @@ async function editItem(sl_id, group_id, item_id, name, count) {
 | 
				
			|||||||
        if (item.count != count && count != undefined) {
 | 
					        if (item.count != count && count != undefined) {
 | 
				
			||||||
            await nonQuery('UPDATE "Item" SET count = $1 WHERE item_id = $2 AND group_id = $3 AND sl_id = $4', [count, item_id, group_id, sl_id]);
 | 
					            await nonQuery('UPDATE "Item" SET count = $1 WHERE item_id = $2 AND group_id = $3 AND sl_id = $4', [count, item_id, group_id, sl_id]);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch (error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -275,9 +248,7 @@ async function deleteGroup(group_id, sl_id) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        //Leere Gruppe löschen
 | 
					        //Leere Gruppe löschen
 | 
				
			||||||
        nonQuery('DELETE FROM "Group" WHERE group_id = $1 AND sl_id = $2', [group_id, sl_id]);
 | 
					        nonQuery('DELETE FROM "Group" WHERE group_id = $1 AND sl_id = $2', [group_id, sl_id]);
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch (error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -287,9 +258,7 @@ async function deleteGroup(group_id, sl_id) {
 | 
				
			|||||||
async function deleteItem(item_id, group_id, sl_id) {
 | 
					async function deleteItem(item_id, group_id, sl_id) {
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
        nonQuery('DELETE FROM "Item" WHERE item_id = $1 AND group_id = $2 AND sl_id = $3;', [item_id, group_id, sl_id]);
 | 
					        nonQuery('DELETE FROM "Item" WHERE item_id = $1 AND group_id = $2 AND sl_id = $3;', [item_id, group_id, sl_id]);
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch(error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -330,9 +299,7 @@ async function moveDoneItems(uid, sl_id, billcontent) {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return "done"
 | 
					        return "done"
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch(error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -343,9 +310,7 @@ async function getDonePurchases(uid) {
 | 
				
			|||||||
    try {
 | 
					    try {
 | 
				
			||||||
        let result = await query('SELECT row_to_json("Done_Purchase") AS obj FROM "Done_Purchase" WHERE username = $1;', [uid]);
 | 
					        let result = await query('SELECT row_to_json("Done_Purchase") AS obj FROM "Done_Purchase" WHERE username = $1;', [uid]);
 | 
				
			||||||
        return result;
 | 
					        return result;
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch(error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -366,9 +331,7 @@ async function verifyInvite(link, user_id) {
 | 
				
			|||||||
        let sl_id = result[0].sl_id;
 | 
					        let sl_id = result[0].sl_id;
 | 
				
			||||||
        console.log("!!! SL ID: ", sl_id);
 | 
					        console.log("!!! SL ID: ", sl_id);
 | 
				
			||||||
        await nonQuery('INSERT INTO "Shoppinglist_member" (username, sl_id) VALUES ($1, $2);', [user_id, sl_id]);
 | 
					        await nonQuery('INSERT INTO "Shoppinglist_member" (username, sl_id) VALUES ($1, $2);', [user_id, sl_id]);
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch (error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -377,9 +340,7 @@ async function createInvite(sl_id) {
 | 
				
			|||||||
    try {
 | 
					    try {
 | 
				
			||||||
        let link = generateInviteLink();
 | 
					        let link = generateInviteLink();
 | 
				
			||||||
        await nonQuery('UPDATE "Shoppinglist" SET invitelink = $1 WHERE sl_id = $2;', [link, sl_id]);
 | 
					        await nonQuery('UPDATE "Shoppinglist" SET invitelink = $1 WHERE sl_id = $2;', [link, sl_id]);
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch (error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -388,9 +349,7 @@ async function createInvite(sl_id) {
 | 
				
			|||||||
async function manInvite(sl_id, uid) {
 | 
					async function manInvite(sl_id, uid) {
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
        await nonQuery('INSERT INTO "Shoppinglist_member" (username, sl_id) VALUES ($1, $2);', [uid, sl_id]);
 | 
					        await nonQuery('INSERT INTO "Shoppinglist_member" (username, sl_id) VALUES ($1, $2);', [uid, sl_id]);
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch(error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -400,9 +359,7 @@ async function manInvite(sl_id, uid) {
 | 
				
			|||||||
async function removeMember(uid, sl_id) {
 | 
					async function removeMember(uid, sl_id) {
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
        await nonQuery('DELETE FROM "Shoppinglist_member" WHERE username = $1 AND sl_id = $2', [uid, sl_id]);
 | 
					        await nonQuery('DELETE FROM "Shoppinglist_member" WHERE username = $1 AND sl_id = $2', [uid, sl_id]);
 | 
				
			||||||
    }
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
    catch(error) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -468,7 +425,9 @@ function items_in_groups(groups, items, sl_id, admin_uid, admin_mid, members, na
 | 
				
			|||||||
            group_id: item.group_id,
 | 
					            group_id: item.group_id,
 | 
				
			||||||
            name: item.name,
 | 
					            name: item.name,
 | 
				
			||||||
            color: item.color,
 | 
					            color: item.color,
 | 
				
			||||||
            content: items.filter(function(obj) {return obj.group_id == item.group_id})
 | 
					            content: items.filter(function (obj) {
 | 
				
			||||||
 | 
					                return obj.group_id == item.group_id
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -516,25 +475,15 @@ function compareData(listitems, doneitems) {
 | 
				
			|||||||
    for (let item of listitems) {
 | 
					    for (let item of listitems) {
 | 
				
			||||||
        if (doneitems.includes(item.name)) {
 | 
					        if (doneitems.includes(item.name)) {
 | 
				
			||||||
            output.push(item);
 | 
					            output.push(item);
 | 
				
			||||||
        }
 | 
					        } else if (doneitems.toUpperCase().includes(item.name.toUpperCase())) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
        else if(doneitems.toUpperCase().includes(item.name.toUpperCase())) {
 | 
					 | 
				
			||||||
            output.push(item);
 | 
					            output.push(item);
 | 
				
			||||||
        }
 | 
					        } else if (doneitems.toLowerCase().includes(item.name.toLowerCase())) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
        else if(doneitems.toLowerCase().includes(item.name.toLowerCase())) {
 | 
					 | 
				
			||||||
            output.push(item);
 | 
					            output.push(item);
 | 
				
			||||||
        }
 | 
					        } else if (probability(item.name, doneitems) > 0.6) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
        else if(probability(item.name, doneitems) > 0.6) {
 | 
					 | 
				
			||||||
            output.push(item);
 | 
					            output.push(item);
 | 
				
			||||||
        }
 | 
					        } else if (probability(item.name.toUpperCase(), doneitems.toUpperCase()) > 0.6) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
        else if(probability(item.name.toUpperCase(), doneitems.toUpperCase()) > 0.6) {
 | 
					 | 
				
			||||||
            output.push(item);
 | 
					            output.push(item);
 | 
				
			||||||
        }
 | 
					        } else if (probability(item.name.toLowerCase(), doneitems.toLowerCase()) > 0.6) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
        else if(probability(item.name.toLowerCase(), doneitems.toLowerCase()) > 0.6) {
 | 
					 | 
				
			||||||
            output.push(item);
 | 
					            output.push(item);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -561,7 +510,25 @@ function probability(cur_item, data) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module.exports = {
 | 
					module.exports = {
 | 
				
			||||||
    getShoppinglistsAdmin, getShoppinglistsShared, newShoppinglist, displayShoppinglist, deleteShoppinglist, addGroup,
 | 
					    getShoppinglistsAdmin,
 | 
				
			||||||
    addItem, verifyInvite, createInvite, editShoppinglist, editGroup, editItem, deleteGroup, deleteItem, manInvite, updateUser,
 | 
					    getShoppinglistsShared,
 | 
				
			||||||
    moveDoneItems, getDonePurchases, getShoppinglistsByLink, searchUsers, removeMember
 | 
					    newShoppinglist,
 | 
				
			||||||
 | 
					    displayShoppinglist,
 | 
				
			||||||
 | 
					    deleteShoppinglist,
 | 
				
			||||||
 | 
					    addGroup,
 | 
				
			||||||
 | 
					    addItem,
 | 
				
			||||||
 | 
					    verifyInvite,
 | 
				
			||||||
 | 
					    createInvite,
 | 
				
			||||||
 | 
					    editShoppinglist,
 | 
				
			||||||
 | 
					    editGroup,
 | 
				
			||||||
 | 
					    editItem,
 | 
				
			||||||
 | 
					    deleteGroup,
 | 
				
			||||||
 | 
					    deleteItem,
 | 
				
			||||||
 | 
					    manInvite,
 | 
				
			||||||
 | 
					    updateUser,
 | 
				
			||||||
 | 
					    moveDoneItems,
 | 
				
			||||||
 | 
					    getDonePurchases,
 | 
				
			||||||
 | 
					    getShoppinglistsByLink,
 | 
				
			||||||
 | 
					    searchUsers,
 | 
				
			||||||
 | 
					    removeMember
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -10,26 +10,32 @@ var greenlock = Greenlock.create({
 | 
				
			|||||||
  // Let's Encrypt v2 is ACME draft 11
 | 
					  // Let's Encrypt v2 is ACME draft 11
 | 
				
			||||||
  version: 'draft-11'
 | 
					  version: 'draft-11'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, server: 'https://acme-v02.api.letsencrypt.org/directory'
 | 
					    ,
 | 
				
			||||||
 | 
					  server: 'https://acme-v02.api.letsencrypt.org/directory'
 | 
				
			||||||
    // Note: If at first you don't succeed, stop and switch to staging
 | 
					    // Note: If at first you don't succeed, stop and switch to staging
 | 
				
			||||||
    // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
					    // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // You MUST change this to a valid email address
 | 
					    // You MUST change this to a valid email address
 | 
				
			||||||
, email: 'jon@example.com'
 | 
					    ,
 | 
				
			||||||
 | 
					  email: 'jon@example.com'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // You MUST NOT build clients that accept the ToS without asking the user
 | 
					    // You MUST NOT build clients that accept the ToS without asking the user
 | 
				
			||||||
, agreeTos: true
 | 
					    ,
 | 
				
			||||||
 | 
					  agreeTos: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // You MUST change these to valid domains
 | 
					    // You MUST change these to valid domains
 | 
				
			||||||
    // NOTE: all domains will validated and listed on the certificate
 | 
					    // NOTE: all domains will validated and listed on the certificate
 | 
				
			||||||
, approvedDomains: [ 'example.com', 'www.example.com' ]
 | 
					    ,
 | 
				
			||||||
 | 
					  approvedDomains: ['example.com', 'www.example.com']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // You MUST have access to write to directory where certs are saved
 | 
					    // You MUST have access to write to directory where certs are saved
 | 
				
			||||||
    // ex: /home/foouser/acme/etc
 | 
					    // ex: /home/foouser/acme/etc
 | 
				
			||||||
, configDir: '~/.config/acme/'
 | 
					    ,
 | 
				
			||||||
 | 
					  configDir: '~/.config/acme/'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Get notified of important updates and help me make greenlock better
 | 
					    // Get notified of important updates and help me make greenlock better
 | 
				
			||||||
, communityMember: true
 | 
					    ,
 | 
				
			||||||
 | 
					  communityMember: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //, debug: true
 | 
					  //, debug: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -45,8 +51,8 @@ var greenlock = Greenlock.create({
 | 
				
			|||||||
var redirectHttps = require('redirect-https')();
 | 
					var redirectHttps = require('redirect-https')();
 | 
				
			||||||
var acmeChallengeHandler = greenlock.middleware(function (req, res) {
 | 
					var acmeChallengeHandler = greenlock.middleware(function (req, res) {
 | 
				
			||||||
  res.setHeader('Content-Type', 'text/html; charset=utf-8');
 | 
					  res.setHeader('Content-Type', 'text/html; charset=utf-8');
 | 
				
			||||||
  res.end('<h1>Hello, ⚠️ Insecure World!</h1><a>Visit Secure Site</a>'
 | 
					  res.end('<h1>Hello, ⚠️ Insecure World!</h1><a>Visit Secure Site</a>' +
 | 
				
			||||||
    + '<script>document.querySelector("a").href=window.location.href.replace(/^http/i, "https");</script>'
 | 
					    '<script>document.querySelector("a").href=window.location.href.replace(/^http/i, "https");</script>'
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
require('http').createServer(acmeChallengeHandler).listen(80, function () {
 | 
					require('http').createServer(acmeChallengeHandler).listen(80, function () {
 | 
				
			||||||
@@ -61,7 +67,10 @@ require('http').createServer(acmeChallengeHandler).listen(80, function () {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// spdy is a drop-in replacement for the https API
 | 
					// spdy is a drop-in replacement for the https API
 | 
				
			||||||
var spdyOptions = Object.assign({}, greenlock.tlsOptions);
 | 
					var spdyOptions = Object.assign({}, greenlock.tlsOptions);
 | 
				
			||||||
spdyOptions.spdy = { protocols: [ 'h2', 'http/1.1' ], plain: false };
 | 
					spdyOptions.spdy = {
 | 
				
			||||||
 | 
					  protocols: ['h2', 'http/1.1'],
 | 
				
			||||||
 | 
					  plain: false
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
var server = require('spdy').createServer(spdyOptions, require('express')().use('/', function (req, res) {
 | 
					var server = require('spdy').createServer(spdyOptions, require('express')().use('/', function (req, res) {
 | 
				
			||||||
  res.setHeader('Content-Type', 'text/html; charset=utf-8');
 | 
					  res.setHeader('Content-Type', 'text/html; charset=utf-8');
 | 
				
			||||||
  res.end('<h1>Hello, 🔐 Secure World!</h1>');
 | 
					  res.end('<h1>Hello, 🔐 Secure World!</h1>');
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,24 +6,31 @@ require('../').create({
 | 
				
			|||||||
  // Let's Encrypt v2 is ACME draft 11
 | 
					  // Let's Encrypt v2 is ACME draft 11
 | 
				
			||||||
  version: 'draft-11'
 | 
					  version: 'draft-11'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, server: 'https://acme-v02.api.letsencrypt.org/directory'
 | 
					    ,
 | 
				
			||||||
 | 
					  server: 'https://acme-v02.api.letsencrypt.org/directory'
 | 
				
			||||||
    // Note: If at first you don't succeed, stop and switch to staging
 | 
					    // Note: If at first you don't succeed, stop and switch to staging
 | 
				
			||||||
    // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
					    // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, email: 'john.doe@example.com'
 | 
					    ,
 | 
				
			||||||
 | 
					  email: 'john.doe@example.com'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, agreeTos: true
 | 
					    ,
 | 
				
			||||||
 | 
					  agreeTos: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, approvedDomains: [ 'example.com', 'www.example.com' ]
 | 
					    ,
 | 
				
			||||||
 | 
					  approvedDomains: ['example.com', 'www.example.com']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, app: require('express')().use('/', function (req, res) {
 | 
					    ,
 | 
				
			||||||
 | 
					  app: require('express')().use('/', function (req, res) {
 | 
				
			||||||
      res.end('Hello, World!');
 | 
					      res.end('Hello, World!');
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, renewWithin: (91 * 24 * 60 * 60 * 1000)
 | 
					    ,
 | 
				
			||||||
, renewBy: (90 * 24 * 60 * 60 * 1000)
 | 
					  renewWithin: (91 * 24 * 60 * 60 * 1000),
 | 
				
			||||||
 | 
					  renewBy: (90 * 24 * 60 * 60 * 1000)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Get notified of important updates and help me make greenlock better
 | 
					    // Get notified of important updates and help me make greenlock better
 | 
				
			||||||
, communityMember: true
 | 
					    ,
 | 
				
			||||||
, debug: true
 | 
					  communityMember: true,
 | 
				
			||||||
 | 
					  debug: true
 | 
				
			||||||
}).listen(80, 443);
 | 
					}).listen(80, 443);
 | 
				
			||||||
@@ -8,26 +8,32 @@ var greenlock = Greenlock.create({
 | 
				
			|||||||
  // Let's Encrypt v2 is ACME draft 11
 | 
					  // Let's Encrypt v2 is ACME draft 11
 | 
				
			||||||
  version: 'draft-11'
 | 
					  version: 'draft-11'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, server: 'https://acme-v02.api.letsencrypt.org/directory'
 | 
					    ,
 | 
				
			||||||
 | 
					  server: 'https://acme-v02.api.letsencrypt.org/directory'
 | 
				
			||||||
    // Note: If at first you don't succeed, stop and switch to staging
 | 
					    // Note: If at first you don't succeed, stop and switch to staging
 | 
				
			||||||
    // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
					    // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // You MUST change this to a valid email address
 | 
					    // You MUST change this to a valid email address
 | 
				
			||||||
, email: 'jon@example.com'
 | 
					    ,
 | 
				
			||||||
 | 
					  email: 'jon@example.com'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // You MUST NOT build clients that accept the ToS without asking the user
 | 
					    // You MUST NOT build clients that accept the ToS without asking the user
 | 
				
			||||||
, agreeTos: true
 | 
					    ,
 | 
				
			||||||
 | 
					  agreeTos: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // You MUST change these to valid domains
 | 
					    // You MUST change these to valid domains
 | 
				
			||||||
    // NOTE: all domains will validated and listed on the certificate
 | 
					    // NOTE: all domains will validated and listed on the certificate
 | 
				
			||||||
, approvedDomains: [ 'example.com', 'www.example.com' ]
 | 
					    ,
 | 
				
			||||||
 | 
					  approvedDomains: ['example.com', 'www.example.com']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // You MUST have access to write to directory where certs are saved
 | 
					    // You MUST have access to write to directory where certs are saved
 | 
				
			||||||
    // ex: /home/foouser/acme/etc
 | 
					    // ex: /home/foouser/acme/etc
 | 
				
			||||||
, configDir: '~/.config/acme/'
 | 
					    ,
 | 
				
			||||||
 | 
					  configDir: '~/.config/acme/'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Get notified of important updates and help me make greenlock better
 | 
					    // Get notified of important updates and help me make greenlock better
 | 
				
			||||||
, communityMember: true
 | 
					    ,
 | 
				
			||||||
 | 
					  communityMember: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //, debug: true
 | 
					  //, debug: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -63,8 +69,8 @@ server.on('error', function (err) {
 | 
				
			|||||||
server.on('stream', function (stream, headers) {
 | 
					server.on('stream', function (stream, headers) {
 | 
				
			||||||
  console.log(headers);
 | 
					  console.log(headers);
 | 
				
			||||||
  stream.respond({
 | 
					  stream.respond({
 | 
				
			||||||
    'content-type': 'text/html'
 | 
					    'content-type': 'text/html',
 | 
				
			||||||
  , ':status': 200
 | 
					    ':status': 200
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
  stream.end('Hello, HTTP2 World!');
 | 
					  stream.end('Hello, HTTP2 World!');
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,7 +9,9 @@ app.use('/', function (req, res) {
 | 
				
			|||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// DO NOT DO app.listen() unless we're testing this directly
 | 
					// DO NOT DO app.listen() unless we're testing this directly
 | 
				
			||||||
if (require.main === module) { app.listen(3000); }
 | 
					if (require.main === module) {
 | 
				
			||||||
 | 
					  app.listen(3000);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Instead do export the app:
 | 
					// Instead do export the app:
 | 
				
			||||||
module.exports = app;
 | 
					module.exports = app;
 | 
				
			||||||
@@ -9,10 +9,11 @@ var greenlock = require('../').create({
 | 
				
			|||||||
  // Let's Encrypt v2 is ACME draft 11
 | 
					  // Let's Encrypt v2 is ACME draft 11
 | 
				
			||||||
  // Note: If at first you don't succeed, stop and switch to staging
 | 
					  // Note: If at first you don't succeed, stop and switch to staging
 | 
				
			||||||
  // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
					  // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
				
			||||||
  server: 'https://acme-v02.api.letsencrypt.org/directory'
 | 
					  server: 'https://acme-v02.api.letsencrypt.org/directory',
 | 
				
			||||||
, version: 'draft-11'
 | 
					  version: 'draft-11'
 | 
				
			||||||
    // You MUST have write access to save certs
 | 
					    // You MUST have write access to save certs
 | 
				
			||||||
, configDir: '~/.config/acme/'
 | 
					    ,
 | 
				
			||||||
 | 
					  configDir: '~/.config/acme/'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // The previous 'simple' example set these values statically,
 | 
					    // The previous 'simple' example set these values statically,
 | 
				
			||||||
    // but this example uses approveDomains() to set them dynamically
 | 
					    // but this example uses approveDomains() to set them dynamically
 | 
				
			||||||
@@ -21,12 +22,15 @@ var greenlock = require('../').create({
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    // approveDomains is the right place to check a database for
 | 
					    // approveDomains is the right place to check a database for
 | 
				
			||||||
    // email addresses with domains and agreements and such
 | 
					    // email addresses with domains and agreements and such
 | 
				
			||||||
, approveDomains: approveDomains
 | 
					    ,
 | 
				
			||||||
 | 
					  approveDomains: approveDomains
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, app: require('./my-express-app.js')
 | 
					    ,
 | 
				
			||||||
 | 
					  app: require('./my-express-app.js')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Get notified of important updates and help me make greenlock better
 | 
					    // Get notified of important updates and help me make greenlock better
 | 
				
			||||||
, communityMember: true
 | 
					    ,
 | 
				
			||||||
 | 
					  communityMember: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //, debug: true
 | 
					  //, debug: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -52,7 +56,10 @@ function approveDomains(opts, certs, cb) {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  fooCheckDb(opts.domains, function (err, agree, email) {
 | 
					  fooCheckDb(opts.domains, function (err, agree, email) {
 | 
				
			||||||
    if (err) { cb(err); return; }
 | 
					    if (err) {
 | 
				
			||||||
 | 
					      cb(err);
 | 
				
			||||||
 | 
					      return;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Services SHOULD automatically accept the ToS and use YOUR email
 | 
					    // Services SHOULD automatically accept the ToS and use YOUR email
 | 
				
			||||||
    // Clients MUST NOT accept the ToS without asking the user
 | 
					    // Clients MUST NOT accept the ToS without asking the user
 | 
				
			||||||
@@ -64,7 +71,10 @@ function approveDomains(opts, certs, cb) {
 | 
				
			|||||||
    // opts.challengeType = 'http-01';
 | 
					    // opts.challengeType = 'http-01';
 | 
				
			||||||
    // opts.challenge = require('le-challenge-fs').create({});
 | 
					    // opts.challenge = require('le-challenge-fs').create({});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    cb(null, { options: opts, certs: certs });
 | 
					    cb(null, {
 | 
				
			||||||
 | 
					      options: opts,
 | 
				
			||||||
 | 
					      certs: certs
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,28 +8,35 @@ require('../greenlock.js').create({
 | 
				
			|||||||
  // Let's Encrypt v2 is ACME draft 11
 | 
					  // Let's Encrypt v2 is ACME draft 11
 | 
				
			||||||
  version: 'draft-11'
 | 
					  version: 'draft-11'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, server: 'https://acme-v02.api.letsencrypt.org/directory'
 | 
					    ,
 | 
				
			||||||
 | 
					  server: 'https://acme-v02.api.letsencrypt.org/directory'
 | 
				
			||||||
    // Note: If at first you don't succeed, stop and switch to staging
 | 
					    // Note: If at first you don't succeed, stop and switch to staging
 | 
				
			||||||
    // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
					    // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // You MUST change this to a valid email address
 | 
					    // You MUST change this to a valid email address
 | 
				
			||||||
, email: 'lukas.n912@gmail.com'
 | 
					    ,
 | 
				
			||||||
 | 
					  email: 'lukas.n912@gmail.com'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // You MUST NOT build clients that accept the ToS without asking the user
 | 
					    // You MUST NOT build clients that accept the ToS without asking the user
 | 
				
			||||||
, agreeTos: true
 | 
					    ,
 | 
				
			||||||
 | 
					  agreeTos: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // You MUST change these to valid domains
 | 
					    // You MUST change these to valid domains
 | 
				
			||||||
    // NOTE: all domains will validated and listed on the certificate
 | 
					    // NOTE: all domains will validated and listed on the certificate
 | 
				
			||||||
, approvedDomains: [ 'www.smartshopper.cf', 'smartshopper.cf']
 | 
					    ,
 | 
				
			||||||
 | 
					  approvedDomains: ['www.smartshopper.cf', 'smartshopper.cf']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // You MUST have access to write to directory where certs are saved
 | 
					    // You MUST have access to write to directory where certs are saved
 | 
				
			||||||
    // ex: /home/foouser/acme/etc
 | 
					    // ex: /home/foouser/acme/etc
 | 
				
			||||||
, configDir: '~/.config/acme/'
 | 
					    ,
 | 
				
			||||||
 | 
					  configDir: '~/.config/acme/'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, app: app
 | 
					    ,
 | 
				
			||||||
 | 
					  app: app
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Get notified of important updates and help me make greenlock better
 | 
					    // Get notified of important updates and help me make greenlock better
 | 
				
			||||||
, communityMember: true
 | 
					    ,
 | 
				
			||||||
 | 
					  communityMember: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //, debug: true
 | 
					  //, debug: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,17 +18,20 @@ var secret = require('crypto').randomBytes(16).toString('hex');
 | 
				
			|||||||
require('../').create({
 | 
					require('../').create({
 | 
				
			||||||
  version: 'draft-11'
 | 
					  version: 'draft-11'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, server: 'https://acme-v02.api.letsencrypt.org/directory'
 | 
					    ,
 | 
				
			||||||
 | 
					  server: 'https://acme-v02.api.letsencrypt.org/directory'
 | 
				
			||||||
    // Note: If at first you don't succeed, stop and switch to staging
 | 
					    // Note: If at first you don't succeed, stop and switch to staging
 | 
				
			||||||
    // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
					    // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, email: email
 | 
					    ,
 | 
				
			||||||
, agreeTos: agreeLeTos
 | 
					  email: email,
 | 
				
			||||||
, approveDomains: domains
 | 
					  agreeTos: agreeLeTos,
 | 
				
			||||||
, configDir: '~/.config/acme/'
 | 
					  approveDomains: domains,
 | 
				
			||||||
, app: remoteAccess(secret)
 | 
					  configDir: '~/.config/acme/',
 | 
				
			||||||
 | 
					  app: remoteAccess(secret)
 | 
				
			||||||
    // Get notified of important updates and help me make greenlock better
 | 
					    // Get notified of important updates and help me make greenlock better
 | 
				
			||||||
, communityMember: true
 | 
					    ,
 | 
				
			||||||
 | 
					  communityMember: true
 | 
				
			||||||
  //, debug: true
 | 
					  //, debug: true
 | 
				
			||||||
}).listen(3000, 8443);
 | 
					}).listen(3000, 8443);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -38,20 +41,39 @@ function remoteAccess(secret) {
 | 
				
			|||||||
  var basicAuth = require('express-basic-auth');
 | 
					  var basicAuth = require('express-basic-auth');
 | 
				
			||||||
  var serveIndex = require('serve-index');
 | 
					  var serveIndex = require('serve-index');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  var rootIndex = serveIndex('/', { hidden: true, icons: true, view: 'details' });
 | 
					  var rootIndex = serveIndex('/', {
 | 
				
			||||||
  var rootFs = express.static('/', { dotfiles: 'allow', redirect: true, index: false });
 | 
					    hidden: true,
 | 
				
			||||||
 | 
					    icons: true,
 | 
				
			||||||
 | 
					    view: 'details'
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					  var rootFs = express.static('/', {
 | 
				
			||||||
 | 
					    dotfiles: 'allow',
 | 
				
			||||||
 | 
					    redirect: true,
 | 
				
			||||||
 | 
					    index: false
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  var userIndex = serveIndex(require('os').homedir(), { hidden: true, icons: true, view: 'details' });
 | 
					  var userIndex = serveIndex(require('os').homedir(), {
 | 
				
			||||||
  var userFs = express.static(require('os').homedir(), { dotfiles: 'allow', redirect: true, index: false });
 | 
					    hidden: true,
 | 
				
			||||||
 | 
					    icons: true,
 | 
				
			||||||
 | 
					    view: 'details'
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					  var userFs = express.static(require('os').homedir(), {
 | 
				
			||||||
 | 
					    dotfiles: 'allow',
 | 
				
			||||||
 | 
					    redirect: true,
 | 
				
			||||||
 | 
					    index: false
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  var app = express();
 | 
					  var app = express();
 | 
				
			||||||
  var realm = 'Login Required';
 | 
					  var realm = 'Login Required';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  var myAuth = basicAuth({
 | 
					  var myAuth = basicAuth({
 | 
				
			||||||
    users: { 'root': secret, 'user': secret }
 | 
					    users: {
 | 
				
			||||||
  , challenge: true
 | 
					      'root': secret,
 | 
				
			||||||
  , realm: realm
 | 
					      'user': secret
 | 
				
			||||||
  , unauthorizedResponse: function (/*req*/) {
 | 
					    },
 | 
				
			||||||
 | 
					    challenge: true,
 | 
				
			||||||
 | 
					    realm: realm,
 | 
				
			||||||
 | 
					    unauthorizedResponse: function ( /*req*/ ) {
 | 
				
			||||||
      return 'Unauthorized <a href="/">Home</a>';
 | 
					      return 'Unauthorized <a href="/">Home</a>';
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
@@ -59,9 +81,9 @@ function remoteAccess(secret) {
 | 
				
			|||||||
  app.get('/', function (req, res) {
 | 
					  app.get('/', function (req, res) {
 | 
				
			||||||
    res.setHeader('Content-Type', 'text/html; charset=utf-8');
 | 
					    res.setHeader('Content-Type', 'text/html; charset=utf-8');
 | 
				
			||||||
    res.end(
 | 
					    res.end(
 | 
				
			||||||
      '<a href="/browse/">View Files</a>'
 | 
					      '<a href="/browse/">View Files</a>' +
 | 
				
			||||||
    + '  |  '
 | 
					      '  |  ' +
 | 
				
			||||||
    + '<a href="/logout/">Logout</a>'
 | 
					      '<a href="/logout/">Logout</a>'
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
  app.use('/logout', function (req, res) {
 | 
					  app.use('/logout', function (req, res) {
 | 
				
			||||||
@@ -73,8 +95,18 @@ function remoteAccess(secret) {
 | 
				
			|||||||
  });
 | 
					  });
 | 
				
			||||||
  app.use('/browse', myAuth);
 | 
					  app.use('/browse', myAuth);
 | 
				
			||||||
  app.use('/browse', function (req, res, next) {
 | 
					  app.use('/browse', function (req, res, next) {
 | 
				
			||||||
    if ('root' === req.auth.user) { rootFs(req, res, function () { rootIndex(req, res, next); }); return; }
 | 
					    if ('root' === req.auth.user) {
 | 
				
			||||||
    if ('user' === req.auth.user) { userFs(req, res, function () { userIndex(req, res, next); }); return; }
 | 
					      rootFs(req, res, function () {
 | 
				
			||||||
 | 
					        rootIndex(req, res, next);
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					      return;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    if ('user' === req.auth.user) {
 | 
				
			||||||
 | 
					      userFs(req, res, function () {
 | 
				
			||||||
 | 
					        userIndex(req, res, next);
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					      return;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    res.end('Sad Panda');
 | 
					    res.end('Sad Panda');
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,26 +10,32 @@ var greenlock = Greenlock.create({
 | 
				
			|||||||
  // Let's Encrypt v2 is ACME draft 11
 | 
					  // Let's Encrypt v2 is ACME draft 11
 | 
				
			||||||
  version: 'draft-11'
 | 
					  version: 'draft-11'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, server: 'https://acme-v02.api.letsencrypt.org/directory'
 | 
					    ,
 | 
				
			||||||
 | 
					  server: 'https://acme-v02.api.letsencrypt.org/directory'
 | 
				
			||||||
    // Note: If at first you don't succeed, stop and switch to staging
 | 
					    // Note: If at first you don't succeed, stop and switch to staging
 | 
				
			||||||
    // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
					    // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // You MUST change this to a valid email address
 | 
					    // You MUST change this to a valid email address
 | 
				
			||||||
, email: 'jon@example.com'
 | 
					    ,
 | 
				
			||||||
 | 
					  email: 'jon@example.com'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // You MUST NOT build clients that accept the ToS without asking the user
 | 
					    // You MUST NOT build clients that accept the ToS without asking the user
 | 
				
			||||||
, agreeTos: true
 | 
					    ,
 | 
				
			||||||
 | 
					  agreeTos: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // You MUST change these to valid domains
 | 
					    // You MUST change these to valid domains
 | 
				
			||||||
    // NOTE: all domains will validated and listed on the certificate
 | 
					    // NOTE: all domains will validated and listed on the certificate
 | 
				
			||||||
, approvedDomains: [ 'example.com', 'www.example.com' ]
 | 
					    ,
 | 
				
			||||||
 | 
					  approvedDomains: ['example.com', 'www.example.com']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // You MUST have access to write to directory where certs are saved
 | 
					    // You MUST have access to write to directory where certs are saved
 | 
				
			||||||
    // ex: /home/foouser/acme/etc
 | 
					    // ex: /home/foouser/acme/etc
 | 
				
			||||||
, configDir: '~/.config/acme/'      // MUST have write access
 | 
					    ,
 | 
				
			||||||
 | 
					  configDir: '~/.config/acme/' // MUST have write access
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Get notified of important updates and help me make greenlock better
 | 
					    // Get notified of important updates and help me make greenlock better
 | 
				
			||||||
, communityMember: true
 | 
					    ,
 | 
				
			||||||
 | 
					  communityMember: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //, debug: true
 | 
					  //, debug: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -56,7 +62,10 @@ require('http').createServer(acmeChallengeHandler).listen(80, function () {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// spdy is a drop-in replacement for the https API
 | 
					// spdy is a drop-in replacement for the https API
 | 
				
			||||||
var spdyOptions = Object.assign({}, greenlock.tlsOptions);
 | 
					var spdyOptions = Object.assign({}, greenlock.tlsOptions);
 | 
				
			||||||
spdyOptions.spdy = { protocols: [ 'h2', 'http/1.1' ], plain: false };
 | 
					spdyOptions.spdy = {
 | 
				
			||||||
 | 
					  protocols: ['h2', 'http/1.1'],
 | 
				
			||||||
 | 
					  plain: false
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
var myApp = require('./my-express-app.js');
 | 
					var myApp = require('./my-express-app.js');
 | 
				
			||||||
var server = require('spdy').createServer(spdyOptions, myApp);
 | 
					var server = require('spdy').createServer(spdyOptions, myApp);
 | 
				
			||||||
server.on('error', function (err) {
 | 
					server.on('error', function (err) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,5 @@
 | 
				
			|||||||
#!/usr/bin/env node
 | 
					#!/usr/bin/env node
 | 
				
			||||||
 | 
					
 | 
				
			||||||
'use strict';
 | 
					'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
///////////////////
 | 
					///////////////////
 | 
				
			||||||
@@ -23,21 +24,28 @@ var glx = require('../').create({
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  version: 'draft-11' // Let's Encrypt v2 is ACME draft 11
 | 
					  version: 'draft-11' // Let's Encrypt v2 is ACME draft 11
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, server: 'https://acme-v02.api.letsencrypt.org/directory'  // If at first you don't succeed, stop and switch to staging
 | 
					    ,
 | 
				
			||||||
 | 
					  server: 'https://acme-v02.api.letsencrypt.org/directory' // If at first you don't succeed, stop and switch to staging
 | 
				
			||||||
    // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
					    // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, configDir: '~/.config/acme/'                              // You MUST have access to write to directory where certs
 | 
					    ,
 | 
				
			||||||
 | 
					  configDir: '~/.config/acme/' // You MUST have access to write to directory where certs
 | 
				
			||||||
    // are saved. ex: /home/foouser/.config/acme
 | 
					    // are saved. ex: /home/foouser/.config/acme
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, approveDomains: myApproveDomains                          // Greenlock's wraps around tls.SNICallback. Check the
 | 
					    ,
 | 
				
			||||||
 | 
					  approveDomains: myApproveDomains // Greenlock's wraps around tls.SNICallback. Check the
 | 
				
			||||||
    // domain name here and reject invalid ones
 | 
					    // domain name here and reject invalid ones
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, app: myVhostApp                                           // Any node-style http app (i.e. express, koa, hapi, rill)
 | 
					    ,
 | 
				
			||||||
 | 
					  app: myVhostApp // Any node-style http app (i.e. express, koa, hapi, rill)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* CHANGE TO A VALID EMAIL */
 | 
					    /* CHANGE TO A VALID EMAIL */
 | 
				
			||||||
, email:'jon@example.com'                                   // Email for Let's Encrypt account and Greenlock Security
 | 
					    ,
 | 
				
			||||||
, agreeTos: true                                            // Accept Let's Encrypt ToS
 | 
					  email: 'jon@example.com' // Email for Let's Encrypt account and Greenlock Security
 | 
				
			||||||
, communityMember: true                                     // Join Greenlock to get important updates, no spam
 | 
					    ,
 | 
				
			||||||
 | 
					  agreeTos: true // Accept Let's Encrypt ToS
 | 
				
			||||||
 | 
					    ,
 | 
				
			||||||
 | 
					  communityMember: true // Join Greenlock to get important updates, no spam
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //, debug: true
 | 
					  //, debug: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -84,7 +92,10 @@ function myApproveDomains(opts, certs, cb) {
 | 
				
			|||||||
    // opts.agreeTos = true;
 | 
					    // opts.agreeTos = true;
 | 
				
			||||||
    // opts.challengeType = 'http-01';
 | 
					    // opts.challengeType = 'http-01';
 | 
				
			||||||
    // opts.challenge = require('le-challenge-fs').create({});
 | 
					    // opts.challenge = require('le-challenge-fs').create({});
 | 
				
			||||||
    cb(null, { options: opts, certs: certs });
 | 
					    cb(null, {
 | 
				
			||||||
 | 
					      options: opts,
 | 
				
			||||||
 | 
					      certs: certs
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -96,6 +107,7 @@ function myApproveDomains(opts, certs, cb) {
 | 
				
			|||||||
// It will also make them lowercase and protect against "domain fronting".
 | 
					// It will also make them lowercase and protect against "domain fronting".
 | 
				
			||||||
// However, it's up to you to make sure you actually have a domain to serve :)
 | 
					// However, it's up to you to make sure you actually have a domain to serve :)
 | 
				
			||||||
var servers = {};
 | 
					var servers = {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function myVhostApp(req, res) {
 | 
					function myVhostApp(req, res) {
 | 
				
			||||||
  var hostname = req.headers.host;
 | 
					  var hostname = req.headers.host;
 | 
				
			||||||
  var srvpath = path.join(srv, hostname);
 | 
					  var srvpath = path.join(srv, hostname);
 | 
				
			||||||
@@ -104,7 +116,9 @@ function myVhostApp(req, res) {
 | 
				
			|||||||
  if (!servers[hostname]) {
 | 
					  if (!servers[hostname]) {
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
      fs.accessSync(srvpath);
 | 
					      fs.accessSync(srvpath);
 | 
				
			||||||
      servers[hostname] = serveStatic(srvpath, { redirect: true });
 | 
					      servers[hostname] = serveStatic(srvpath, {
 | 
				
			||||||
 | 
					        redirect: true
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
    } catch (e) {
 | 
					    } catch (e) {
 | 
				
			||||||
      finalhandler(req, res);
 | 
					      finalhandler(req, res);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,29 +12,35 @@ var greenlock = Greenlock.create({
 | 
				
			|||||||
  // Let's Encrypt v2 is ACME draft 11
 | 
					  // Let's Encrypt v2 is ACME draft 11
 | 
				
			||||||
  // Note: If at first you don't succeed, stop and switch to staging
 | 
					  // Note: If at first you don't succeed, stop and switch to staging
 | 
				
			||||||
  // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
					  // https://acme-staging-v02.api.letsencrypt.org/directory
 | 
				
			||||||
  server: 'https://acme-v02.api.letsencrypt.org/directory'
 | 
					  server: 'https://acme-v02.api.letsencrypt.org/directory',
 | 
				
			||||||
, version: 'draft-11'
 | 
					  version: 'draft-11',
 | 
				
			||||||
, configDir: '~/.config/acme/'
 | 
					  configDir: '~/.config/acme/',
 | 
				
			||||||
, app: require('./my-express-app.js')
 | 
					  app: require('./my-express-app.js')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // You MUST change these to a valid email and domains
 | 
					    // You MUST change these to a valid email and domains
 | 
				
			||||||
, email: 'john.doe@example.com'
 | 
					    ,
 | 
				
			||||||
, approvedDomains: [ 'example.com', 'www.example.com' ]
 | 
					  email: 'john.doe@example.com',
 | 
				
			||||||
, agreeTos: true
 | 
					  approvedDomains: ['example.com', 'www.example.com'],
 | 
				
			||||||
 | 
					  agreeTos: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Get notified of important updates and help me make greenlock better
 | 
					    // Get notified of important updates and help me make greenlock better
 | 
				
			||||||
, communityMember: true
 | 
					    ,
 | 
				
			||||||
, telemetry: true
 | 
					  communityMember: true,
 | 
				
			||||||
 | 
					  telemetry: true
 | 
				
			||||||
  //, debug: true
 | 
					  //, debug: true
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var server = greenlock.listen(80, 443);
 | 
					var server = greenlock.listen(80, 443);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var WebSocket = require('ws');
 | 
					var WebSocket = require('ws');
 | 
				
			||||||
var ws = new WebSocket.Server({ server: server });
 | 
					var ws = new WebSocket.Server({
 | 
				
			||||||
 | 
					  server: server
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
ws.on('connection', function (ws, req) {
 | 
					ws.on('connection', function (ws, req) {
 | 
				
			||||||
  // inspect req.headers.authorization (or cookies) for session info
 | 
					  // inspect req.headers.authorization (or cookies) for session info
 | 
				
			||||||
  ws.send("[Secure Echo Server] Hello!\nAuth: '" + (req.headers.authorization || 'none') + "'\n"
 | 
					  ws.send("[Secure Echo Server] Hello!\nAuth: '" + (req.headers.authorization || 'none') + "'\n" +
 | 
				
			||||||
    + "Cookie: '" + (req.headers.cookie || 'none') + "'\n");
 | 
					    "Cookie: '" + (req.headers.cookie || 'none') + "'\n");
 | 
				
			||||||
  ws.on('message', function (data) { ws.send(data); });
 | 
					  ws.on('message', function (data) {
 | 
				
			||||||
 | 
					    ws.send(data);
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
@@ -31,7 +31,9 @@ module.exports.create = function (opts) {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  function _listen(plainPort, plain) {
 | 
					  function _listen(plainPort, plain) {
 | 
				
			||||||
    if (!plainPort) { plainPort = 80; }
 | 
					    if (!plainPort) {
 | 
				
			||||||
 | 
					      plainPort = 80;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    var parts = String(plainPort).split(':');
 | 
					    var parts = String(plainPort).split(':');
 | 
				
			||||||
    var p = parts.pop();
 | 
					    var p = parts.pop();
 | 
				
			||||||
@@ -52,15 +54,17 @@ module.exports.create = function (opts) {
 | 
				
			|||||||
      var https;
 | 
					      var https;
 | 
				
			||||||
      try {
 | 
					      try {
 | 
				
			||||||
        https = require('spdy');
 | 
					        https = require('spdy');
 | 
				
			||||||
        greenlock.tlsOptions.spdy = { protocols: [ 'h2', 'http/1.1' ], plain: false };
 | 
					        greenlock.tlsOptions.spdy = {
 | 
				
			||||||
 | 
					          protocols: ['h2', 'http/1.1'],
 | 
				
			||||||
 | 
					          plain: false
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
        httpType = 'http2 (spdy/h2)';
 | 
					        httpType = 'http2 (spdy/h2)';
 | 
				
			||||||
      } catch (e) {
 | 
					      } catch (e) {
 | 
				
			||||||
        https = require('https');
 | 
					        https = require('https');
 | 
				
			||||||
        httpType = 'https';
 | 
					        httpType = 'https';
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      server = https.createServer(
 | 
					      server = https.createServer(
 | 
				
			||||||
        greenlock.tlsOptions
 | 
					        greenlock.tlsOptions, greenlock.middleware.sanitizeHost(function (req, res) {
 | 
				
			||||||
      , greenlock.middleware.sanitizeHost(function (req, res) {
 | 
					 | 
				
			||||||
          try {
 | 
					          try {
 | 
				
			||||||
            greenlock.app(req, res);
 | 
					            greenlock.app(req, res);
 | 
				
			||||||
          } catch (e) {
 | 
					          } catch (e) {
 | 
				
			||||||
@@ -79,15 +83,23 @@ module.exports.create = function (opts) {
 | 
				
			|||||||
      server.type = httpType;
 | 
					      server.type = httpType;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (addr) { args[1] = addr; }
 | 
					    if (addr) {
 | 
				
			||||||
 | 
					      args[1] = addr;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    if (!validHttpPort && !/(\/)|(\\\\)/.test(p)) {
 | 
					    if (!validHttpPort && !/(\/)|(\\\\)/.test(p)) {
 | 
				
			||||||
      console.warn("'" + p + "' doesn't seem to be a valid port number, socket path, or pipe");
 | 
					      console.warn("'" + p + "' doesn't seem to be a valid port number, socket path, or pipe");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (plain) { tryPlain(); } else { trySecure(); }
 | 
					    if (plain) {
 | 
				
			||||||
 | 
					      tryPlain();
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      trySecure();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    var promise = new PromiseA(function (resolve) {
 | 
					    var promise = new PromiseA(function (resolve) {
 | 
				
			||||||
      args[0] = p;
 | 
					      args[0] = p;
 | 
				
			||||||
      args.push(function () { resolve(server); });
 | 
					      args.push(function () {
 | 
				
			||||||
 | 
					        resolve(server);
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
      server.listen.apply(server, args).on('error', function (e) {
 | 
					      server.listen.apply(server, args).on('error', function (e) {
 | 
				
			||||||
        if (server.listenerCount('error') < 2) {
 | 
					        if (server.listenerCount('error') < 2) {
 | 
				
			||||||
          console.warn("Did not successfully create http server and bind to port '" + p + "':");
 | 
					          console.warn("Did not successfully create http server and bind to port '" + p + "':");
 | 
				
			||||||
@@ -133,8 +145,8 @@ module.exports.create = function (opts) {
 | 
				
			|||||||
      if ('function' === typeof fnPlain) {
 | 
					      if ('function' === typeof fnPlain) {
 | 
				
			||||||
        fnPlain.apply(plainServer);
 | 
					        fnPlain.apply(plainServer);
 | 
				
			||||||
      } else if (!fn && !plainServer.listenerCount('listening') && !server.listenerCount('listening')) {
 | 
					      } else if (!fn && !plainServer.listenerCount('listening') && !server.listenerCount('listening')) {
 | 
				
			||||||
        console.info('[:' + (plainServer.address().port || plainServer.address())
 | 
					        console.info('[:' + (plainServer.address().port || plainServer.address()) +
 | 
				
			||||||
          + "] Handling ACME challenges and redirecting to " + server.type);
 | 
					          "] Handling ACME challenges and redirecting to " + server.type);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      // Report h2/https status
 | 
					      // Report h2/https status
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,7 +31,9 @@ module.exports.create = function (opts) {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  function _listen(plainPort, plain) {
 | 
					  function _listen(plainPort, plain) {
 | 
				
			||||||
    if (!plainPort) { plainPort = 80; }
 | 
					    if (!plainPort) {
 | 
				
			||||||
 | 
					      plainPort = 80;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    var parts = String(plainPort).split(':');
 | 
					    var parts = String(plainPort).split(':');
 | 
				
			||||||
    var p = parts.pop();
 | 
					    var p = parts.pop();
 | 
				
			||||||
@@ -52,15 +54,17 @@ module.exports.create = function (opts) {
 | 
				
			|||||||
      var https;
 | 
					      var https;
 | 
				
			||||||
      try {
 | 
					      try {
 | 
				
			||||||
        https = require('spdy');
 | 
					        https = require('spdy');
 | 
				
			||||||
        greenlock.tlsOptions.spdy = { protocols: [ 'h2', 'http/1.1' ], plain: false };
 | 
					        greenlock.tlsOptions.spdy = {
 | 
				
			||||||
 | 
					          protocols: ['h2', 'http/1.1'],
 | 
				
			||||||
 | 
					          plain: false
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
        httpType = 'http2 (spdy/h2)';
 | 
					        httpType = 'http2 (spdy/h2)';
 | 
				
			||||||
      } catch (e) {
 | 
					      } catch (e) {
 | 
				
			||||||
        https = require('https');
 | 
					        https = require('https');
 | 
				
			||||||
        httpType = 'https';
 | 
					        httpType = 'https';
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      server = https.createServer(
 | 
					      server = https.createServer(
 | 
				
			||||||
        greenlock.tlsOptions
 | 
					        greenlock.tlsOptions, greenlock.middleware.sanitizeHost(function (req, res) {
 | 
				
			||||||
      , greenlock.middleware.sanitizeHost(function (req, res) {
 | 
					 | 
				
			||||||
          try {
 | 
					          try {
 | 
				
			||||||
            greenlock.app(req, res);
 | 
					            greenlock.app(req, res);
 | 
				
			||||||
          } catch (e) {
 | 
					          } catch (e) {
 | 
				
			||||||
@@ -79,15 +83,23 @@ module.exports.create = function (opts) {
 | 
				
			|||||||
      server.type = httpType;
 | 
					      server.type = httpType;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (addr) { args[1] = addr; }
 | 
					    if (addr) {
 | 
				
			||||||
 | 
					      args[1] = addr;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    if (!validHttpPort && !/(\/)|(\\\\)/.test(p)) {
 | 
					    if (!validHttpPort && !/(\/)|(\\\\)/.test(p)) {
 | 
				
			||||||
      console.warn("'" + p + "' doesn't seem to be a valid port number, socket path, or pipe");
 | 
					      console.warn("'" + p + "' doesn't seem to be a valid port number, socket path, or pipe");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (plain) { tryPlain(); } else { trySecure(); }
 | 
					    if (plain) {
 | 
				
			||||||
 | 
					      tryPlain();
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      trySecure();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    var promise = new PromiseA(function (resolve) {
 | 
					    var promise = new PromiseA(function (resolve) {
 | 
				
			||||||
      args[0] = p;
 | 
					      args[0] = p;
 | 
				
			||||||
      args.push(function () { resolve(server); });
 | 
					      args.push(function () {
 | 
				
			||||||
 | 
					        resolve(server);
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
      server.listen.apply(server, args).on('error', function (e) {
 | 
					      server.listen.apply(server, args).on('error', function (e) {
 | 
				
			||||||
        if (server.listenerCount('error') < 2) {
 | 
					        if (server.listenerCount('error') < 2) {
 | 
				
			||||||
          console.warn("Did not successfully create http server and bind to port '" + p + "':");
 | 
					          console.warn("Did not successfully create http server and bind to port '" + p + "':");
 | 
				
			||||||
@@ -133,8 +145,8 @@ module.exports.create = function (opts) {
 | 
				
			|||||||
      if ('function' === typeof fnPlain) {
 | 
					      if ('function' === typeof fnPlain) {
 | 
				
			||||||
        fnPlain.apply(plainServer);
 | 
					        fnPlain.apply(plainServer);
 | 
				
			||||||
      } else if (!fn && !plainServer.listenerCount('listening') && !server.listenerCount('listening')) {
 | 
					      } else if (!fn && !plainServer.listenerCount('listening') && !server.listenerCount('listening')) {
 | 
				
			||||||
        console.info('[:' + (plainServer.address().port || plainServer.address())
 | 
					        console.info('[:' + (plainServer.address().port || plainServer.address()) +
 | 
				
			||||||
          + "] Handling ACME challenges and redirecting to " + server.type);
 | 
					          "] Handling ACME challenges and redirecting to " + server.type);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      // Report h2/https status
 | 
					      // Report h2/https status
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,5 +23,7 @@ messaging.setBackgroundMessageHandler(payload => {
 | 
				
			|||||||
  // }
 | 
					  // }
 | 
				
			||||||
  // return self.registration.showNotification(title, options)
 | 
					  // return self.registration.showNotification(title, options)
 | 
				
			||||||
  const title = payload.data.title
 | 
					  const title = payload.data.title
 | 
				
			||||||
    new Notification(title, { body: payload.data.text});
 | 
					  new Notification(title, {
 | 
				
			||||||
 | 
					    body: payload.data.text
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
@@ -26,7 +26,9 @@ var config = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    function verifyInvite(link) {
 | 
					    function verifyInvite(link) {
 | 
				
			||||||
        //alert("Ore Link", link)
 | 
					        //alert("Ore Link", link)
 | 
				
			||||||
    firebase.auth().onAuthStateChanged(function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
					        firebase.auth().onAuthStateChanged(function (user) {
 | 
				
			||||||
 | 
					            if (user) {
 | 
				
			||||||
 | 
					                firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) {
 | 
				
			||||||
                    $.ajax({
 | 
					                    $.ajax({
 | 
				
			||||||
                        type: "POST",
 | 
					                        type: "POST",
 | 
				
			||||||
                        url: "/invitemember",
 | 
					                        url: "/invitemember",
 | 
				
			||||||
@@ -44,11 +46,17 @@ var config = {
 | 
				
			|||||||
                            window.location.href = "/dash/" + idtoken
 | 
					                            window.location.href = "/dash/" + idtoken
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
    }).catch((error) => console.error("Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
					                }).catch((error) => console.error("Get id token client error: ", error));
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                console.log("Check Auth error", user)
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    function getList(link) {
 | 
					    function getList(link) {
 | 
				
			||||||
    firebase.auth().onAuthStateChanged(function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
					        firebase.auth().onAuthStateChanged(function (user) {
 | 
				
			||||||
 | 
					            if (user) {
 | 
				
			||||||
 | 
					                firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) {
 | 
				
			||||||
                    $.ajax({
 | 
					                    $.ajax({
 | 
				
			||||||
                        type: "GET",
 | 
					                        type: "GET",
 | 
				
			||||||
                        url: "/shoppinglistsbylink?link=" + link,
 | 
					                        url: "/shoppinglistsbylink?link=" + link,
 | 
				
			||||||
@@ -58,15 +66,25 @@ var config = {
 | 
				
			|||||||
                        success(data) {
 | 
					                        success(data) {
 | 
				
			||||||
                            console.log(data);
 | 
					                            console.log(data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                $(".s_name").append(data.find(function(obj) {return obj.invitelink == link}).name);
 | 
					                            $(".s_name").append(data.find(function (obj) {
 | 
				
			||||||
                $(".s_desc").append(data.find(function(obj) {return obj.invitelink == link}).description);
 | 
					                                return obj.invitelink == link
 | 
				
			||||||
                $(".s_link").append(data.find(function(obj) {return obj.invitelink == link}).invitelink);
 | 
					                            }).name);
 | 
				
			||||||
 | 
					                            $(".s_desc").append(data.find(function (obj) {
 | 
				
			||||||
 | 
					                                return obj.invitelink == link
 | 
				
			||||||
 | 
					                            }).description);
 | 
				
			||||||
 | 
					                            $(".s_link").append(data.find(function (obj) {
 | 
				
			||||||
 | 
					                                return obj.invitelink == link
 | 
				
			||||||
 | 
					                            }).invitelink);
 | 
				
			||||||
                        },
 | 
					                        },
 | 
				
			||||||
                        error(err) {
 | 
					                        error(err) {
 | 
				
			||||||
                            console.error("Error: " + err);
 | 
					                            console.error("Error: " + err);
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
    }).catch((error) => console.error("Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
					                }).catch((error) => console.error("Get id token client error: ", error));
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                console.log("Check Auth error", user)
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $(".btn_verify").click(function () {
 | 
					    $(".btn_verify").click(function () {
 | 
				
			||||||
@@ -78,4 +96,3 @@ var config = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,13 +14,19 @@ firebase.initializeApp(config);
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(document).ready(function () {
 | 
					$(document).ready(function () {
 | 
				
			||||||
    firebase.auth().onAuthStateChanged(async function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
					    firebase.auth().onAuthStateChanged(async function (user) {
 | 
				
			||||||
 | 
					        if (user) {
 | 
				
			||||||
 | 
					            firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) {
 | 
				
			||||||
                console.log("/shoppinglistx idtoken:", idtoken);
 | 
					                console.log("/shoppinglistx idtoken:", idtoken);
 | 
				
			||||||
                var url = "/dash/" + idtoken
 | 
					                var url = "/dash/" + idtoken
 | 
				
			||||||
                console.log("URL: ", url)
 | 
					                console.log("URL: ", url)
 | 
				
			||||||
                $('#dashurl').attr("href", url);
 | 
					                $('#dashurl').attr("href", url);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }).catch((error) => console.error("/shoppinglist Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
					            }).catch((error) => console.error("/shoppinglist Get id token client error: ", error));
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            console.log("Check Auth error", user)
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    eigeneEinkaufslisten();
 | 
					    eigeneEinkaufslisten();
 | 
				
			||||||
    geteilteEinkaufslisten();
 | 
					    geteilteEinkaufslisten();
 | 
				
			||||||
@@ -40,7 +46,9 @@ $(document).ready(function() {
 | 
				
			|||||||
        console.log("click add");
 | 
					        console.log("click add");
 | 
				
			||||||
        // let name = $("#einkaufslistenname").val();
 | 
					        // let name = $("#einkaufslistenname").val();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        firebase.auth().onAuthStateChanged(async function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
					        firebase.auth().onAuthStateChanged(async function (user) {
 | 
				
			||||||
 | 
					            if (user) {
 | 
				
			||||||
 | 
					                firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) {
 | 
				
			||||||
                    console.log("/shoppinglistx idtoken:", idtoken);
 | 
					                    console.log("/shoppinglistx idtoken:", idtoken);
 | 
				
			||||||
                    $.ajax({
 | 
					                    $.ajax({
 | 
				
			||||||
                        type: "POST",
 | 
					                        type: "POST",
 | 
				
			||||||
@@ -62,7 +70,11 @@ $(document).ready(function() {
 | 
				
			|||||||
                            console.log("/shoppinglist error", err);
 | 
					                            console.log("/shoppinglist error", err);
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
        }).catch((error) => console.error("/shoppinglist Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
					                }).catch((error) => console.error("/shoppinglist Get id token client error: ", error));
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                console.log("Check Auth error", user)
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -103,7 +115,9 @@ var globaleAddZwischenID = "";
 | 
				
			|||||||
// var globaleGetZwischenID = "";
 | 
					// var globaleGetZwischenID = "";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function eigeneEinkaufslisten() {
 | 
					function eigeneEinkaufslisten() {
 | 
				
			||||||
    firebase.auth().onAuthStateChanged(async function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
					    firebase.auth().onAuthStateChanged(async function (user) {
 | 
				
			||||||
 | 
					        if (user) {
 | 
				
			||||||
 | 
					            firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) {
 | 
				
			||||||
                console.log("/myshoppinglists idtoke: ", idtoken);
 | 
					                console.log("/myshoppinglists idtoke: ", idtoken);
 | 
				
			||||||
                $.ajax({
 | 
					                $.ajax({
 | 
				
			||||||
                    type: "GET",
 | 
					                    type: "GET",
 | 
				
			||||||
@@ -112,7 +126,9 @@ function eigeneEinkaufslisten(){
 | 
				
			|||||||
                        idtoken: idtoken
 | 
					                        idtoken: idtoken
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                    success(res) {
 | 
					                    success(res) {
 | 
				
			||||||
                firebase.auth().onAuthStateChanged(async function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
					                        firebase.auth().onAuthStateChanged(async function (user) {
 | 
				
			||||||
 | 
					                            if (user) {
 | 
				
			||||||
 | 
					                                firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) {
 | 
				
			||||||
                                    console.log("/userinfo_json idtoken: ", idtoken)
 | 
					                                    console.log("/userinfo_json idtoken: ", idtoken)
 | 
				
			||||||
                                    $.ajax({
 | 
					                                    $.ajax({
 | 
				
			||||||
                                        type: "GET",
 | 
					                                        type: "GET",
 | 
				
			||||||
@@ -142,8 +158,7 @@ function eigeneEinkaufslisten(){
 | 
				
			|||||||
                                        <h5 class="card-title">${el.name}</h5>
 | 
					                                        <h5 class="card-title">${el.name}</h5>
 | 
				
			||||||
                                        <p class="card-text">${el.description}</p>
 | 
					                                        <p class="card-text">${el.description}</p>
 | 
				
			||||||
                                    </div>
 | 
					                                    </div>
 | 
				
			||||||
                                </div></div>`
 | 
					                                </div></div>`)
 | 
				
			||||||
                                )
 | 
					 | 
				
			||||||
                                            }
 | 
					                                            }
 | 
				
			||||||
                                            console.log("Eigene Einkaufslisten");
 | 
					                                            console.log("Eigene Einkaufslisten");
 | 
				
			||||||
                                            loeschen();
 | 
					                                            loeschen();
 | 
				
			||||||
@@ -155,17 +170,27 @@ function eigeneEinkaufslisten(){
 | 
				
			|||||||
                                            console.error("userinfo_json error: ", err)
 | 
					                                            console.error("userinfo_json error: ", err)
 | 
				
			||||||
                                        }
 | 
					                                        }
 | 
				
			||||||
                                    })
 | 
					                                    })
 | 
				
			||||||
                }).catch((error) => console.error("Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
					                                }).catch((error) => console.error("Get id token client error: ", error));
 | 
				
			||||||
 | 
					                            } else {
 | 
				
			||||||
 | 
					                                console.log("Check Auth error", user)
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        });
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                    error(err) {
 | 
					                    error(err) {
 | 
				
			||||||
                        console.error("/myshoppinglists ajax error: ", err);
 | 
					                        console.error("/myshoppinglists ajax error: ", err);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
    }).catch((error) => console.error("Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
					            }).catch((error) => console.error("Get id token client error: ", error));
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            console.log("Check Auth error", user)
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function geteilteEinkaufslisten() {
 | 
					function geteilteEinkaufslisten() {
 | 
				
			||||||
    firebase.auth().onAuthStateChanged(async function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
					    firebase.auth().onAuthStateChanged(async function (user) {
 | 
				
			||||||
 | 
					        if (user) {
 | 
				
			||||||
 | 
					            firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) {
 | 
				
			||||||
                console.log("/sharedshoppinglists idtoke: ", idtoken)
 | 
					                console.log("/sharedshoppinglists idtoke: ", idtoken)
 | 
				
			||||||
                $.ajax({
 | 
					                $.ajax({
 | 
				
			||||||
                    data: "GET",
 | 
					                    data: "GET",
 | 
				
			||||||
@@ -180,7 +205,11 @@ function geteilteEinkaufslisten(){
 | 
				
			|||||||
                        console.error("/sharedshoppinglists error:", err);
 | 
					                        console.error("/sharedshoppinglists error:", err);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
    }).catch((error) => console.error("Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
					            }).catch((error) => console.error("Get id token client error: ", error));
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            console.log("Check Auth error", user)
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function loeschen() {
 | 
					function loeschen() {
 | 
				
			||||||
@@ -195,7 +224,8 @@ function loeschen(){
 | 
				
			|||||||
            type: "DELETE",
 | 
					            type: "DELETE",
 | 
				
			||||||
            url: "/shoppinglist",
 | 
					            url: "/shoppinglist",
 | 
				
			||||||
            data: {
 | 
					            data: {
 | 
				
			||||||
                sl_id: id},
 | 
					                sl_id: id
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
            success(res) {
 | 
					            success(res) {
 | 
				
			||||||
                console.log("card gelöscht");
 | 
					                console.log("card gelöscht");
 | 
				
			||||||
                card.remove();
 | 
					                card.remove();
 | 
				
			||||||
@@ -225,7 +255,9 @@ function Detail(){
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        let card = $(this).closest(".card");
 | 
					        let card = $(this).closest(".card");
 | 
				
			||||||
        let id = card.attr("id");
 | 
					        let id = card.attr("id");
 | 
				
			||||||
        firebase.auth().onAuthStateChanged(async function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
					        firebase.auth().onAuthStateChanged(async function (user) {
 | 
				
			||||||
 | 
					            if (user) {
 | 
				
			||||||
 | 
					                firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) {
 | 
				
			||||||
                    $.ajax({
 | 
					                    $.ajax({
 | 
				
			||||||
                        type: "GET",
 | 
					                        type: "GET",
 | 
				
			||||||
                        url: "/shoppinglist_json/" + id,
 | 
					                        url: "/shoppinglist_json/" + id,
 | 
				
			||||||
@@ -306,7 +338,11 @@ function Detail(){
 | 
				
			|||||||
                            console.log("Detail error shoppinglist_json: ", err);
 | 
					                            console.log("Detail error shoppinglist_json: ", err);
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
        }).catch((error) => console.error("Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
					                }).catch((error) => console.error("Get id token client error: ", error));
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                console.log("Check Auth error", user)
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -321,7 +357,9 @@ function ItemAdden(){
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        $('.GroupItemAdd').modal('show');
 | 
					        $('.GroupItemAdd').modal('show');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        firebase.auth().onAuthStateChanged(async function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
					        firebase.auth().onAuthStateChanged(async function (user) {
 | 
				
			||||||
 | 
					            if (user) {
 | 
				
			||||||
 | 
					                firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) {
 | 
				
			||||||
                    $.ajax({
 | 
					                    $.ajax({
 | 
				
			||||||
                        type: "GET",
 | 
					                        type: "GET",
 | 
				
			||||||
                        url: "/shoppinglist_json/" + id,
 | 
					                        url: "/shoppinglist_json/" + id,
 | 
				
			||||||
@@ -344,7 +382,11 @@ function ItemAdden(){
 | 
				
			|||||||
                            console.log(err);
 | 
					                            console.log(err);
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
        }).catch((error) => console.error("Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
					                }).catch((error) => console.error("Get id token client error: ", error));
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                console.log("Check Auth error", user)
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -368,7 +410,8 @@ $(".itemhinzu").click(function(){
 | 
				
			|||||||
        },
 | 
					        },
 | 
				
			||||||
        success(result) {
 | 
					        success(result) {
 | 
				
			||||||
            console.log("post item");
 | 
					            console.log("post item");
 | 
				
			||||||
        },error(err){
 | 
					        },
 | 
				
			||||||
 | 
					        error(err) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
@@ -393,7 +436,8 @@ function groupdelete(){
 | 
				
			|||||||
            url: "/group",
 | 
					            url: "/group",
 | 
				
			||||||
            data: {
 | 
					            data: {
 | 
				
			||||||
                sl_id: shoplistid,
 | 
					                sl_id: shoplistid,
 | 
				
			||||||
                group_id: groupid},
 | 
					                group_id: groupid
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
            success(res) {
 | 
					            success(res) {
 | 
				
			||||||
                console.log("card gelöscht");
 | 
					                console.log("card gelöscht");
 | 
				
			||||||
                $(`.${groupid}`).remove();
 | 
					                $(`.${groupid}`).remove();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,55 +11,77 @@
 | 
				
			|||||||
})(this, function () {
 | 
					})(this, function () {
 | 
				
			||||||
	return /******/ (function (modules) { // webpackBootstrap
 | 
						return /******/ (function (modules) { // webpackBootstrap
 | 
				
			||||||
		/******/ // The module cache
 | 
							/******/ // The module cache
 | 
				
			||||||
/******/ 	var installedModules = {};
 | 
							/******/
 | 
				
			||||||
 | 
							var installedModules = {};
 | 
				
			||||||
		/******/
 | 
							/******/
 | 
				
			||||||
		/******/ // The require function
 | 
							/******/ // The require function
 | 
				
			||||||
/******/ 	function __webpack_require__(moduleId) {
 | 
							/******/
 | 
				
			||||||
 | 
							function __webpack_require__(moduleId) {
 | 
				
			||||||
			/******/
 | 
								/******/
 | 
				
			||||||
			/******/ // Check if module is in cache
 | 
								/******/ // Check if module is in cache
 | 
				
			||||||
/******/ 		if(installedModules[moduleId])
 | 
								/******/
 | 
				
			||||||
/******/ 			return installedModules[moduleId].exports;
 | 
								if (installedModules[moduleId])
 | 
				
			||||||
 | 
									/******/
 | 
				
			||||||
 | 
									return installedModules[moduleId].exports;
 | 
				
			||||||
			/******/
 | 
								/******/
 | 
				
			||||||
			/******/ // Create a new module (and put it into the cache)
 | 
								/******/ // Create a new module (and put it into the cache)
 | 
				
			||||||
/******/ 		var module = installedModules[moduleId] = {
 | 
								/******/
 | 
				
			||||||
/******/ 			exports: {},
 | 
								var module = installedModules[moduleId] = {
 | 
				
			||||||
/******/ 			id: moduleId,
 | 
									/******/
 | 
				
			||||||
/******/ 			loaded: false
 | 
									exports: {},
 | 
				
			||||||
/******/ 		};
 | 
									/******/
 | 
				
			||||||
 | 
									id: moduleId,
 | 
				
			||||||
 | 
									/******/
 | 
				
			||||||
 | 
									loaded: false
 | 
				
			||||||
 | 
									/******/
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
			/******/
 | 
								/******/
 | 
				
			||||||
			/******/ // Execute the module function
 | 
								/******/ // Execute the module function
 | 
				
			||||||
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
 | 
								/******/
 | 
				
			||||||
 | 
								modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
 | 
				
			||||||
			/******/
 | 
								/******/
 | 
				
			||||||
			/******/ // Flag the module as loaded
 | 
								/******/ // Flag the module as loaded
 | 
				
			||||||
/******/ 		module.loaded = true;
 | 
								/******/
 | 
				
			||||||
 | 
								module.loaded = true;
 | 
				
			||||||
			/******/
 | 
								/******/
 | 
				
			||||||
			/******/ // Return the exports of the module
 | 
								/******/ // Return the exports of the module
 | 
				
			||||||
/******/ 		return module.exports;
 | 
								/******/
 | 
				
			||||||
/******/ 	}
 | 
								return module.exports;
 | 
				
			||||||
 | 
								/******/
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		/******/
 | 
							/******/
 | 
				
			||||||
		/******/
 | 
							/******/
 | 
				
			||||||
		/******/ // expose the modules object (__webpack_modules__)
 | 
							/******/ // expose the modules object (__webpack_modules__)
 | 
				
			||||||
/******/ 	__webpack_require__.m = modules;
 | 
							/******/
 | 
				
			||||||
 | 
							__webpack_require__.m = modules;
 | 
				
			||||||
		/******/
 | 
							/******/
 | 
				
			||||||
		/******/ // expose the module cache
 | 
							/******/ // expose the module cache
 | 
				
			||||||
/******/ 	__webpack_require__.c = installedModules;
 | 
							/******/
 | 
				
			||||||
 | 
							__webpack_require__.c = installedModules;
 | 
				
			||||||
		/******/
 | 
							/******/
 | 
				
			||||||
		/******/ // __webpack_public_path__
 | 
							/******/ // __webpack_public_path__
 | 
				
			||||||
/******/ 	__webpack_require__.p = "";
 | 
							/******/
 | 
				
			||||||
 | 
							__webpack_require__.p = "";
 | 
				
			||||||
		/******/
 | 
							/******/
 | 
				
			||||||
		/******/ // Load entry module and return exports
 | 
							/******/ // Load entry module and return exports
 | 
				
			||||||
/******/ 	return __webpack_require__(0);
 | 
							/******/
 | 
				
			||||||
/******/ })
 | 
							return __webpack_require__(0);
 | 
				
			||||||
 | 
							/******/
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
	/************************************************************************/
 | 
						/************************************************************************/
 | 
				
			||||||
/******/ ([
 | 
						/******/
 | 
				
			||||||
 | 
						([
 | 
				
			||||||
		/* 0 */
 | 
							/* 0 */
 | 
				
			||||||
/***/ (function(module, exports, __webpack_require__) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports, __webpack_require__) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			module.exports = __webpack_require__(1);
 | 
								module.exports = __webpack_require__(1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 1 */
 | 
							/* 1 */
 | 
				
			||||||
/***/ (function(module, exports, __webpack_require__) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports, __webpack_require__) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -115,9 +137,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			module.exports.default = axios;
 | 
								module.exports.default = axios;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 2 */
 | 
							/* 2 */
 | 
				
			||||||
/***/ (function(module, exports, __webpack_require__) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports, __webpack_require__) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -367,6 +391,7 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			 */
 | 
								 */
 | 
				
			||||||
			function merge( /* obj1, obj2, obj3, ... */ ) {
 | 
								function merge( /* obj1, obj2, obj3, ... */ ) {
 | 
				
			||||||
				var result = {};
 | 
									var result = {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				function assignValue(val, key) {
 | 
									function assignValue(val, key) {
 | 
				
			||||||
					if (typeof result[key] === 'object' && typeof val === 'object') {
 | 
										if (typeof result[key] === 'object' && typeof val === 'object') {
 | 
				
			||||||
						result[key] = merge(result[key], val);
 | 
											result[key] = merge(result[key], val);
 | 
				
			||||||
@@ -424,9 +449,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			};
 | 
								};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 3 */
 | 
							/* 3 */
 | 
				
			||||||
/***/ (function(module, exports) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -441,9 +468,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			};
 | 
								};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 4 */
 | 
							/* 4 */
 | 
				
			||||||
/***/ (function(module, exports) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			/*!
 | 
								/*!
 | 
				
			||||||
			 * Determine if an object is a Buffer
 | 
								 * Determine if an object is a Buffer
 | 
				
			||||||
@@ -468,9 +497,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 5 */
 | 
							/* 5 */
 | 
				
			||||||
/***/ (function(module, exports, __webpack_require__) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports, __webpack_require__) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -506,7 +537,9 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
					}, arguments[1]);
 | 
										}, arguments[1]);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	  config = utils.merge(defaults, {method: 'get'}, this.defaults, config);
 | 
									config = utils.merge(defaults, {
 | 
				
			||||||
 | 
										method: 'get'
 | 
				
			||||||
 | 
									}, this.defaults, config);
 | 
				
			||||||
				config.method = config.method.toLowerCase();
 | 
									config.method = config.method.toLowerCase();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				// Hook up interceptors middleware
 | 
									// Hook up interceptors middleware
 | 
				
			||||||
@@ -553,9 +586,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			module.exports = Axios;
 | 
								module.exports = Axios;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 6 */
 | 
							/* 6 */
 | 
				
			||||||
/***/ (function(module, exports, __webpack_require__) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports, __webpack_require__) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -617,7 +652,8 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
					if (typeof data === 'string') {
 | 
										if (typeof data === 'string') {
 | 
				
			||||||
						try {
 | 
											try {
 | 
				
			||||||
							data = JSON.parse(data);
 | 
												data = JSON.parse(data);
 | 
				
			||||||
	      } catch (e) { /* Ignore */ }
 | 
											} catch (e) {
 | 
				
			||||||
 | 
												/* Ignore */ }
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
					return data;
 | 
										return data;
 | 
				
			||||||
				}],
 | 
									}],
 | 
				
			||||||
@@ -655,9 +691,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			module.exports = defaults;
 | 
								module.exports = defaults;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 7 */
 | 
							/* 7 */
 | 
				
			||||||
/***/ (function(module, exports, __webpack_require__) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports, __webpack_require__) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -673,9 +711,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			};
 | 
								};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 8 */
 | 
							/* 8 */
 | 
				
			||||||
/***/ (function(module, exports, __webpack_require__) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports, __webpack_require__) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -859,9 +899,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			};
 | 
								};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 9 */
 | 
							/* 9 */
 | 
				
			||||||
/***/ (function(module, exports, __webpack_require__) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports, __webpack_require__) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -891,9 +933,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			};
 | 
								};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 10 */
 | 
							/* 10 */
 | 
				
			||||||
/***/ (function(module, exports, __webpack_require__) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports, __webpack_require__) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -915,9 +959,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			};
 | 
								};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 11 */
 | 
							/* 11 */
 | 
				
			||||||
/***/ (function(module, exports) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -942,9 +988,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			};
 | 
								};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 12 */
 | 
							/* 12 */
 | 
				
			||||||
/***/ (function(module, exports, __webpack_require__) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports, __webpack_require__) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1014,9 +1062,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			};
 | 
								};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 13 */
 | 
							/* 13 */
 | 
				
			||||||
/***/ (function(module, exports, __webpack_require__) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports, __webpack_require__) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1050,7 +1100,9 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
				var val;
 | 
									var val;
 | 
				
			||||||
				var i;
 | 
									var i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	  if (!headers) { return parsed; }
 | 
									if (!headers) {
 | 
				
			||||||
 | 
										return parsed;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				utils.forEach(headers.split('\n'), function parser(line) {
 | 
									utils.forEach(headers.split('\n'), function parser(line) {
 | 
				
			||||||
					i = line.indexOf(':');
 | 
										i = line.indexOf(':');
 | 
				
			||||||
@@ -1073,9 +1125,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			};
 | 
								};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 14 */
 | 
							/* 14 */
 | 
				
			||||||
/***/ (function(module, exports, __webpack_require__) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports, __webpack_require__) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1118,8 +1172,7 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
							hostname: urlParsingNode.hostname,
 | 
												hostname: urlParsingNode.hostname,
 | 
				
			||||||
							port: urlParsingNode.port,
 | 
												port: urlParsingNode.port,
 | 
				
			||||||
							pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
 | 
												pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
 | 
				
			||||||
	                  urlParsingNode.pathname :
 | 
													urlParsingNode.pathname : '/' + urlParsingNode.pathname
 | 
				
			||||||
	                  '/' + urlParsingNode.pathname
 | 
					 | 
				
			||||||
						};
 | 
											};
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1147,9 +1200,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			);
 | 
								);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 15 */
 | 
							/* 15 */
 | 
				
			||||||
/***/ (function(module, exports) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1189,9 +1244,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			module.exports = btoa;
 | 
								module.exports = btoa;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 16 */
 | 
							/* 16 */
 | 
				
			||||||
/***/ (function(module, exports, __webpack_require__) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports, __webpack_require__) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1241,16 +1298,20 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
				(function nonStandardBrowserEnv() {
 | 
									(function nonStandardBrowserEnv() {
 | 
				
			||||||
					return {
 | 
										return {
 | 
				
			||||||
						write: function write() {},
 | 
											write: function write() {},
 | 
				
			||||||
	      read: function read() { return null; },
 | 
											read: function read() {
 | 
				
			||||||
 | 
												return null;
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
						remove: function remove() {}
 | 
											remove: function remove() {}
 | 
				
			||||||
					};
 | 
										};
 | 
				
			||||||
				})()
 | 
									})()
 | 
				
			||||||
			);
 | 
								);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 17 */
 | 
							/* 17 */
 | 
				
			||||||
/***/ (function(module, exports, __webpack_require__) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports, __webpack_require__) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1306,9 +1367,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			module.exports = InterceptorManager;
 | 
								module.exports = InterceptorManager;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 18 */
 | 
							/* 18 */
 | 
				
			||||||
/***/ (function(module, exports, __webpack_require__) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports, __webpack_require__) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1398,9 +1461,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			};
 | 
								};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 19 */
 | 
							/* 19 */
 | 
				
			||||||
/***/ (function(module, exports, __webpack_require__) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports, __webpack_require__) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1424,9 +1489,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			};
 | 
								};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 20 */
 | 
							/* 20 */
 | 
				
			||||||
/***/ (function(module, exports) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1435,9 +1502,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			};
 | 
								};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 21 */
 | 
							/* 21 */
 | 
				
			||||||
/***/ (function(module, exports) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1455,9 +1524,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			};
 | 
								};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 22 */
 | 
							/* 22 */
 | 
				
			||||||
/***/ (function(module, exports) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1469,15 +1540,17 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			 * @returns {string} The combined URL
 | 
								 * @returns {string} The combined URL
 | 
				
			||||||
			 */
 | 
								 */
 | 
				
			||||||
			module.exports = function combineURLs(baseURL, relativeURL) {
 | 
								module.exports = function combineURLs(baseURL, relativeURL) {
 | 
				
			||||||
	  return relativeURL
 | 
									return relativeURL ?
 | 
				
			||||||
	    ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
 | 
										baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') :
 | 
				
			||||||
	    : baseURL;
 | 
										baseURL;
 | 
				
			||||||
			};
 | 
								};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 23 */
 | 
							/* 23 */
 | 
				
			||||||
/***/ (function(module, exports) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1500,9 +1573,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			module.exports = Cancel;
 | 
								module.exports = Cancel;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 24 */
 | 
							/* 24 */
 | 
				
			||||||
/***/ (function(module, exports, __webpack_require__) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports, __webpack_require__) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1563,9 +1638,11 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			module.exports = CancelToken;
 | 
								module.exports = CancelToken;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ }),
 | 
								/***/
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		/* 25 */
 | 
							/* 25 */
 | 
				
			||||||
/***/ (function(module, exports) {
 | 
							/***/
 | 
				
			||||||
 | 
							(function (module, exports) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			'use strict';
 | 
								'use strict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1596,8 +1673,9 @@ return /******/ (function(modules) { // webpackBootstrap
 | 
				
			|||||||
			};
 | 
								};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***/ })
 | 
								/***/
 | 
				
			||||||
/******/ ])
 | 
							})
 | 
				
			||||||
});
 | 
							/******/
 | 
				
			||||||
;
 | 
						])
 | 
				
			||||||
 | 
					});;
 | 
				
			||||||
//# sourceMappingURL=axios.map
 | 
					//# sourceMappingURL=axios.map
 | 
				
			||||||
@@ -1,14 +1,3 @@
 | 
				
			|||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// var admin = require("firebase-admin");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// var serviceAccount = require("firebaseAdminKey.json");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// admin.initializeApp({
 | 
					 | 
				
			||||||
//   credential: admin.credential.cert(serviceAccount),
 | 
					 | 
				
			||||||
//   databaseURL: "https://test-667ca.firebaseio.com"
 | 
					 | 
				
			||||||
// });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
var msg = firebase.messaging();
 | 
					var msg = firebase.messaging();
 | 
				
			||||||
msg.requestPermission()
 | 
					msg.requestPermission()
 | 
				
			||||||
    .then(function () {
 | 
					    .then(function () {
 | 
				
			||||||
@@ -26,7 +15,9 @@ msg.requestPermission()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function updateUser(token) {
 | 
					function updateUser(token) {
 | 
				
			||||||
  firebase.auth().onAuthStateChanged(function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
					    firebase.auth().onAuthStateChanged(function (user) {
 | 
				
			||||||
 | 
					        if (user) {
 | 
				
			||||||
 | 
					            firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) {
 | 
				
			||||||
                $.ajax({
 | 
					                $.ajax({
 | 
				
			||||||
                    type: "POST",
 | 
					                    type: "POST",
 | 
				
			||||||
                    url: "/user",
 | 
					                    url: "/user",
 | 
				
			||||||
@@ -41,10 +32,16 @@ function updateUser(token) {
 | 
				
			|||||||
                        console.error("Error: " + err);
 | 
					                        console.error("Error: " + err);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
  }).catch((error) => console.error("Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
					            }).catch((error) => console.error("Get id token client error: ", error));
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            console.log("Check Auth error", user)
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
msg.onMessage(payload => {
 | 
					msg.onMessage(payload => {
 | 
				
			||||||
    const title = payload.data.title
 | 
					    const title = payload.data.title
 | 
				
			||||||
    new Notification(title, { body: payload.data.body});
 | 
					    new Notification(title, {
 | 
				
			||||||
 | 
					        body: payload.data.body
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
@@ -1,5 +1,3 @@
 | 
				
			|||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Initialize Firebase
 | 
					// Initialize Firebase
 | 
				
			||||||
var config = {
 | 
					var config = {
 | 
				
			||||||
  apiKey: "AIzaSyCuvwf78cmSDoZ2yS4XxHZhnjUn7yIHYfw",
 | 
					  apiKey: "AIzaSyCuvwf78cmSDoZ2yS4XxHZhnjUn7yIHYfw",
 | 
				
			||||||
@@ -45,7 +43,8 @@ window.onload = function(){
 | 
				
			|||||||
var vue = new Vue({
 | 
					var vue = new Vue({
 | 
				
			||||||
  el: '#vue-app',
 | 
					  el: '#vue-app',
 | 
				
			||||||
  data: {
 | 
					  data: {
 | 
				
			||||||
 | 
					      email: "",
 | 
				
			||||||
 | 
					      password: ""
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  methods: {
 | 
					  methods: {
 | 
				
			||||||
    login() {
 | 
					    login() {
 | 
				
			||||||
@@ -70,6 +69,16 @@ var vue = new Vue({
 | 
				
			|||||||
        var credential = error.credential;
 | 
					        var credential = error.credential;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    loginemail(){
 | 
				
			||||||
 | 
					      firebase.auth().signInWithEmailAndPassword(this.email, this.password).then(result =>{
 | 
				
			||||||
 | 
					        checkAuth();
 | 
				
			||||||
 | 
					      }).catch(function(error) {
 | 
				
			||||||
 | 
					        // Handle Errors here.
 | 
				
			||||||
 | 
					        var errorCode = error.code;
 | 
				
			||||||
 | 
					        var errorMessage = error.message;
 | 
				
			||||||
 | 
					        // ...
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,7 +37,8 @@ $(document).ready(function() {
 | 
				
			|||||||
                name: $(".name").val(),
 | 
					                name: $(".name").val(),
 | 
				
			||||||
                description: $(".description").val(),
 | 
					                description: $(".description").val(),
 | 
				
			||||||
                color: "red"
 | 
					                color: "red"
 | 
				
			||||||
            }, success(result) {
 | 
					            },
 | 
				
			||||||
 | 
					            success(result) {
 | 
				
			||||||
                refresh();
 | 
					                refresh();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
@@ -49,7 +50,8 @@ $(document).ready(function() {
 | 
				
			|||||||
            url: "/shoppinglist",
 | 
					            url: "/shoppinglist",
 | 
				
			||||||
            data: {
 | 
					            data: {
 | 
				
			||||||
                sl_id: $(this).closest("tr").attr("id")
 | 
					                sl_id: $(this).closest("tr").attr("id")
 | 
				
			||||||
            }, success(result) {
 | 
					            },
 | 
				
			||||||
 | 
					            success(result) {
 | 
				
			||||||
                refresh();
 | 
					                refresh();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
@@ -66,8 +68,8 @@ function refresh() {
 | 
				
			|||||||
        success(data) {
 | 
					        success(data) {
 | 
				
			||||||
            for (let item of data) {
 | 
					            for (let item of data) {
 | 
				
			||||||
                $(".tb_myshoppinglists").append("<tr id='" + item.sl_id + "'><td>" + item.name + "</td><td>" + item.description +
 | 
					                $(".tb_myshoppinglists").append("<tr id='" + item.sl_id + "'><td>" + item.name + "</td><td>" + item.description +
 | 
				
			||||||
                 "</td><td> <a class='btn-floating btn-large waves-effect waves-light red btn_detail'><i class='material-icons'>forward</i></a></td>"  
 | 
					                    "</td><td> <a class='btn-floating btn-large waves-effect waves-light red btn_detail'><i class='material-icons'>forward</i></a></td>" +
 | 
				
			||||||
                 + "<td><a class='btn-floating btn-large waves-effect waves-light red btn_delete'><i class='material-icons'>clear</i></a></td></tr>");
 | 
					                    "<td><a class='btn-floating btn-large waves-effect waves-light red btn_delete'><i class='material-icons'>clear</i></a></td></tr>");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,7 +10,9 @@ $(document).ready(function () {
 | 
				
			|||||||
    navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.oGetUserMedia || navigator.msGetUserMedia;
 | 
					    navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.oGetUserMedia || navigator.msGetUserMedia;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (navigator.getUserMedia) {
 | 
					    if (navigator.getUserMedia) {
 | 
				
			||||||
        navigator.getUserMedia({ video: true }, streamWebcam, throwError);
 | 
					        navigator.getUserMedia({
 | 
				
			||||||
 | 
					            video: true
 | 
				
			||||||
 | 
					        }, streamWebcam, throwError);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $(".btnsnap").click(function () {
 | 
					    $(".btnsnap").click(function () {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,12 +1,49 @@
 | 
				
			|||||||
"use strict";
 | 
					"use strict";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
 | 
					var _createClass = function () {
 | 
				
			||||||
 | 
					  function defineProperties(target, props) {
 | 
				
			||||||
 | 
					    for (var i = 0; i < props.length; i++) {
 | 
				
			||||||
 | 
					      var descriptor = props[i];
 | 
				
			||||||
 | 
					      descriptor.enumerable = descriptor.enumerable || false;
 | 
				
			||||||
 | 
					      descriptor.configurable = true;
 | 
				
			||||||
 | 
					      if ("value" in descriptor) descriptor.writable = true;
 | 
				
			||||||
 | 
					      Object.defineProperty(target, descriptor.key, descriptor);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  return function (Constructor, protoProps, staticProps) {
 | 
				
			||||||
 | 
					    if (protoProps) defineProperties(Constructor.prototype, protoProps);
 | 
				
			||||||
 | 
					    if (staticProps) defineProperties(Constructor, staticProps);
 | 
				
			||||||
 | 
					    return Constructor;
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					}();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
 | 
					function _possibleConstructorReturn(self, call) {
 | 
				
			||||||
 | 
					  if (!self) {
 | 
				
			||||||
 | 
					    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  return call && (typeof call === "object" || typeof call === "function") ? call : self;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
 | 
					function _inherits(subClass, superClass) {
 | 
				
			||||||
 | 
					  if (typeof superClass !== "function" && superClass !== null) {
 | 
				
			||||||
 | 
					    throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  subClass.prototype = Object.create(superClass && superClass.prototype, {
 | 
				
			||||||
 | 
					    constructor: {
 | 
				
			||||||
 | 
					      value: subClass,
 | 
				
			||||||
 | 
					      enumerable: false,
 | 
				
			||||||
 | 
					      writable: true,
 | 
				
			||||||
 | 
					      configurable: true
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					  if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 | 
					function _classCallCheck(instance, Constructor) {
 | 
				
			||||||
 | 
					  if (!(instance instanceof Constructor)) {
 | 
				
			||||||
 | 
					    throw new TypeError("Cannot call a class as a function");
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
@@ -487,7 +524,13 @@ var Dropzone = function (_Emitter) {
 | 
				
			|||||||
         * Allows you to translate the different units. Starting with `tb` for terabytes and going down to
 | 
					         * Allows you to translate the different units. Starting with `tb` for terabytes and going down to
 | 
				
			||||||
         * `b` for bytes.
 | 
					         * `b` for bytes.
 | 
				
			||||||
         */
 | 
					         */
 | 
				
			||||||
        dictFileSizeUnits: { tb: "TB", gb: "GB", mb: "MB", kb: "KB", b: "b" },
 | 
					        dictFileSizeUnits: {
 | 
				
			||||||
 | 
					          tb: "TB",
 | 
				
			||||||
 | 
					          gb: "GB",
 | 
				
			||||||
 | 
					          mb: "MB",
 | 
				
			||||||
 | 
					          kb: "KB",
 | 
				
			||||||
 | 
					          b: "b"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
        /**
 | 
					        /**
 | 
				
			||||||
         * Called when dropzone initialized
 | 
					         * Called when dropzone initialized
 | 
				
			||||||
         * You can add event listeners here
 | 
					         * You can add event listeners here
 | 
				
			||||||
@@ -1345,7 +1388,8 @@ var Dropzone = function (_Emitter) {
 | 
				
			|||||||
          // "paste": (e) =>
 | 
					          // "paste": (e) =>
 | 
				
			||||||
          //   noPropagation e
 | 
					          //   noPropagation e
 | 
				
			||||||
          //   @paste e
 | 
					          //   @paste e
 | 
				
			||||||
        } }];
 | 
					        }
 | 
				
			||||||
 | 
					      }];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      this.clickableElements.forEach(function (clickableElement) {
 | 
					      this.clickableElements.forEach(function (clickableElement) {
 | 
				
			||||||
        return _this3.listeners.push({
 | 
					        return _this3.listeners.push({
 | 
				
			||||||
@@ -2987,7 +3031,8 @@ Dropzone.discover = function () {
 | 
				
			|||||||
//
 | 
					//
 | 
				
			||||||
Dropzone.blacklistedBrowsers = [
 | 
					Dropzone.blacklistedBrowsers = [
 | 
				
			||||||
  // The mac os and windows phone version of opera 12 seems to have a problem with the File drag'n'drop API.
 | 
					  // The mac os and windows phone version of opera 12 seems to have a problem with the File drag'n'drop API.
 | 
				
			||||||
/opera.*(Macintosh|Windows Phone).*version\/12/i];
 | 
					  /opera.*(Macintosh|Windows Phone).*version\/12/i
 | 
				
			||||||
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Checks if the browser is supported
 | 
					// Checks if the browser is supported
 | 
				
			||||||
Dropzone.isBrowserSupported = function () {
 | 
					Dropzone.isBrowserSupported = function () {
 | 
				
			||||||
@@ -3041,7 +3086,9 @@ Dropzone.dataURItoBlob = function (dataURI) {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // write the ArrayBuffer to a blob
 | 
					  // write the ArrayBuffer to a blob
 | 
				
			||||||
  return new Blob([ab], { type: mimeString });
 | 
					  return new Blob([ab], {
 | 
				
			||||||
 | 
					    type: mimeString
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Returns an array without the rejected item
 | 
					// Returns an array without the rejected item
 | 
				
			||||||
@@ -3521,6 +3568,7 @@ contentLoaded(window, Dropzone._autoDiscoverFunction);
 | 
				
			|||||||
function __guard__(value, transform) {
 | 
					function __guard__(value, transform) {
 | 
				
			||||||
  return typeof value !== 'undefined' && value !== null ? transform(value) : undefined;
 | 
					  return typeof value !== 'undefined' && value !== null ? transform(value) : undefined;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function __guardMethod__(obj, methodName, transform) {
 | 
					function __guardMethod__(obj, methodName, transform) {
 | 
				
			||||||
  if (typeof obj !== 'undefined' && obj !== null && typeof obj[methodName] === 'function') {
 | 
					  if (typeof obj !== 'undefined' && obj !== null && typeof obj[methodName] === 'function') {
 | 
				
			||||||
    return transform(obj, methodName);
 | 
					    return transform(obj, methodName);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,8 +16,7 @@ $(document).ready(function() {
 | 
				
			|||||||
    if ($(window).width() > 600) {
 | 
					    if ($(window).width() > 600) {
 | 
				
			||||||
        //large     
 | 
					        //large     
 | 
				
			||||||
        $(".col").css("height", "100%");
 | 
					        $(".col").css("height", "100%");
 | 
				
			||||||
        }
 | 
					    } else {
 | 
				
			||||||
        else {
 | 
					 | 
				
			||||||
        //small    
 | 
					        //small    
 | 
				
			||||||
        $(".col").css("height", "50%");
 | 
					        $(".col").css("height", "50%");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -51,7 +50,9 @@ var config = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    function movePurchases(text) {
 | 
					    function movePurchases(text) {
 | 
				
			||||||
    firebase.auth().onAuthStateChanged(function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
					        firebase.auth().onAuthStateChanged(function (user) {
 | 
				
			||||||
 | 
					            if (user) {
 | 
				
			||||||
 | 
					                firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) {
 | 
				
			||||||
                    $.ajax({
 | 
					                    $.ajax({
 | 
				
			||||||
                        type: "POST",
 | 
					                        type: "POST",
 | 
				
			||||||
                        url: "/dones",
 | 
					                        url: "/dones",
 | 
				
			||||||
@@ -68,7 +69,11 @@ function movePurchases(text) {
 | 
				
			|||||||
                            console.error("Error: " + err);
 | 
					                            console.error("Error: " + err);
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
    }).catch((error) => console.error("Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
					                }).catch((error) => console.error("Get id token client error: ", error));
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                console.log("Check Auth error", user)
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $(".test").click(function () {
 | 
					    $(".test").click(function () {
 | 
				
			||||||
@@ -77,9 +82,15 @@ $(".test").click(function() {
 | 
				
			|||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $(document).on("click", ".btndash", function () {
 | 
					    $(document).on("click", ".btndash", function () {
 | 
				
			||||||
    firebase.auth().onAuthStateChanged(function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
					        firebase.auth().onAuthStateChanged(function (user) {
 | 
				
			||||||
 | 
					            if (user) {
 | 
				
			||||||
 | 
					                firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) {
 | 
				
			||||||
                    window.location.href = "/dash/" + idtoken
 | 
					                    window.location.href = "/dash/" + idtoken
 | 
				
			||||||
    }).catch((error) => console.error("Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
					                }).catch((error) => console.error("Get id token client error: ", error));
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                console.log("Check Auth error", user)
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    function analyzeUploaded() {
 | 
					    function analyzeUploaded() {
 | 
				
			||||||
@@ -111,7 +122,9 @@ function updateProgress(percent) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    function updateUser() {
 | 
					    function updateUser() {
 | 
				
			||||||
    firebase.auth().onAuthStateChanged(function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
					        firebase.auth().onAuthStateChanged(function (user) {
 | 
				
			||||||
 | 
					            if (user) {
 | 
				
			||||||
 | 
					                firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) {
 | 
				
			||||||
                    $.ajax({
 | 
					                    $.ajax({
 | 
				
			||||||
                        type: "POST",
 | 
					                        type: "POST",
 | 
				
			||||||
                        url: "/user",
 | 
					                        url: "/user",
 | 
				
			||||||
@@ -126,7 +139,11 @@ function updateUser() {
 | 
				
			|||||||
                            console.error("Error: " + err);
 | 
					                            console.error("Error: " + err);
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
    }).catch((error) => console.error("Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
					                }).catch((error) => console.error("Get id token client error: ", error));
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                console.log("Check Auth error", user)
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    function testSearch() {
 | 
					    function testSearch() {
 | 
				
			||||||
@@ -149,7 +166,9 @@ function testSearch() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    function getAllShoppinglists() {
 | 
					    function getAllShoppinglists() {
 | 
				
			||||||
    firebase.auth().onAuthStateChanged(function(user){if(user){firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idtoken) {
 | 
					        firebase.auth().onAuthStateChanged(function (user) {
 | 
				
			||||||
 | 
					            if (user) {
 | 
				
			||||||
 | 
					                firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) {
 | 
				
			||||||
                    $.ajax({
 | 
					                    $.ajax({
 | 
				
			||||||
                        type: "GET",
 | 
					                        type: "GET",
 | 
				
			||||||
                        url: "/myshoppinglists",
 | 
					                        url: "/myshoppinglists",
 | 
				
			||||||
@@ -168,7 +187,11 @@ function getAllShoppinglists() {
 | 
				
			|||||||
                            console.error("Error: " + err);
 | 
					                            console.error("Error: " + err);
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
    }).catch((error) => console.error("Get id token client error: ", error));}else{console.log("Check Auth error", user)}});
 | 
					                }).catch((error) => console.error("Get id token client error: ", error));
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                console.log("Check Auth error", user)
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $(document).on("click", ".collection-item", function () {
 | 
					    $(document).on("click", ".collection-item", function () {
 | 
				
			||||||
@@ -180,7 +203,11 @@ $(document).on("click", ".collection-item", function() {
 | 
				
			|||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $(".btncont").click(function () {
 | 
					    $(".btncont").click(function () {
 | 
				
			||||||
    run([{y:100}, {y:0}], $(".r1"));
 | 
					        run([{
 | 
				
			||||||
 | 
					            y: 100
 | 
				
			||||||
 | 
					        }, {
 | 
				
			||||||
 | 
					            y: 0
 | 
				
			||||||
 | 
					        }], $(".r1"));
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    function run(v, elem) {
 | 
					    function run(v, elem) {
 | 
				
			||||||
@@ -198,9 +225,17 @@ function run(v, elem){
 | 
				
			|||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $(".opt1").click(function () {
 | 
					    $(".opt1").click(function () {
 | 
				
			||||||
    run([{y:0}, {y:-100}], $(".r1"))
 | 
					        run([{
 | 
				
			||||||
 | 
					            y: 0
 | 
				
			||||||
 | 
					        }, {
 | 
				
			||||||
 | 
					            y: -100
 | 
				
			||||||
 | 
					        }], $(".r1"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    run([{y:0}, {y:-100}], $(".r2"));
 | 
					        run([{
 | 
				
			||||||
 | 
					            y: 0
 | 
				
			||||||
 | 
					        }, {
 | 
				
			||||||
 | 
					            y: -100
 | 
				
			||||||
 | 
					        }], $(".r2"));
 | 
				
			||||||
        //$("#modal2").modal("open");
 | 
					        //$("#modal2").modal("open");
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -229,4 +264,3 @@ var loading = false;
 | 
				
			|||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,9 +1,4 @@
 | 
				
			|||||||
var admin = require('firebase-admin');
 | 
					
 | 
				
			||||||
var serviceAccount = require('../login/firebaseAdminKey.json');
 | 
					 | 
				
			||||||
var firebaseAdmin = admin.initializeApp({
 | 
					 | 
				
			||||||
    credential: admin.credential.cert(serviceAccount),
 | 
					 | 
				
			||||||
    databaseURL: 'https://test-667ca.firebaseio.com'
 | 
					 | 
				
			||||||
  });
 | 
					 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
function sendPush(msgtoken, title, text){
 | 
					function sendPush(msgtoken, title, text){
 | 
				
			||||||
  var message = {
 | 
					  var message = {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,24 +8,12 @@ var push = require("./../push/push");
 | 
				
			|||||||
var postgres = require("./../db-connect/db-connect");
 | 
					var postgres = require("./../db-connect/db-connect");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Initialize Firebase
 | 
					var admin = require('firebase-admin');
 | 
				
			||||||
// const config = {
 | 
					var serviceAccount = require('../login/firebaseAdminKey.json');
 | 
				
			||||||
//   apiKey: "AIzaSyCuvwf78cmSDoZ2yS4XxHZhnjUn7yIHYfw",
 | 
					var firebaseAdmin = admin.initializeApp({
 | 
				
			||||||
//   authDomain: "test-667ca.firebaseapp.com",
 | 
					    credential: admin.credential.cert(serviceAccount),
 | 
				
			||||||
//   databaseURL: "https://test-667ca.firebaseio.com",
 | 
					    databaseURL: 'https://test-667ca.firebaseio.com'
 | 
				
			||||||
//   projectId: "test-667ca",
 | 
					  });
 | 
				
			||||||
//   storageBucket: "test-667ca.appspot.com",
 | 
					 | 
				
			||||||
//   messagingSenderId: "221332577314"
 | 
					 | 
				
			||||||
// };
 | 
					 | 
				
			||||||
// firebase.initializeApp(config);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
//Push
 | 
					//Push
 | 
				
			||||||
router.get('/push/:msgtoken/:message/:title', function (req, res, next) {
 | 
					router.get('/push/:msgtoken/:message/:title', function (req, res, next) {
 | 
				
			||||||
@@ -77,9 +65,7 @@ router.get("/myshoppinglists",async function(req, res, next) {
 | 
				
			|||||||
      try {
 | 
					      try {
 | 
				
			||||||
        //Get user id: req.session.passport.user.profile.id
 | 
					        //Get user id: req.session.passport.user.profile.id
 | 
				
			||||||
        res.status(200).send(await postgres.getShoppinglistsAdmin(uid));
 | 
					        res.status(200).send(await postgres.getShoppinglistsAdmin(uid));
 | 
				
			||||||
      }
 | 
					      } catch (err) {
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
      catch(err) {
 | 
					 | 
				
			||||||
        res.status(400).send(await err);
 | 
					        res.status(400).send(await err);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -117,9 +103,7 @@ router.get("/sharedshoppinglists", async function(req, res, next) {
 | 
				
			|||||||
      try {
 | 
					      try {
 | 
				
			||||||
        //Get user id: req.session.passport.user.profile.id
 | 
					        //Get user id: req.session.passport.user.profile.id
 | 
				
			||||||
        res.status(200).send(await postgres.getShoppinglistsShared(uid));
 | 
					        res.status(200).send(await postgres.getShoppinglistsShared(uid));
 | 
				
			||||||
      }
 | 
					      } catch (err) {
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
      catch(err) {
 | 
					 | 
				
			||||||
        res.status(400).send(await err);
 | 
					        res.status(400).send(await err);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -141,9 +125,7 @@ router.get("/shoppinglistsbylink", async function(req, res, next) {
 | 
				
			|||||||
      try {
 | 
					      try {
 | 
				
			||||||
        //Get user id: req.session.passport.user.profile.id
 | 
					        //Get user id: req.session.passport.user.profile.id
 | 
				
			||||||
        res.status(200).send(await postgres.getShoppinglistsByLink(req.query.link));
 | 
					        res.status(200).send(await postgres.getShoppinglistsByLink(req.query.link));
 | 
				
			||||||
      }
 | 
					      } catch (err) {
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
      catch(err) {
 | 
					 | 
				
			||||||
        res.status(400).send(await err);
 | 
					        res.status(400).send(await err);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -170,9 +152,7 @@ router.post("/shoppinglist", async function(req, res, next) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        res.status(200).send(await postgres.newShoppinglist(req.body.name, req.body.description, uid, req.body.color));
 | 
					        res.status(200).send(await postgres.newShoppinglist(req.body.name, req.body.description, uid, req.body.color));
 | 
				
			||||||
        sendPush("enG4tJ6LyyU:APA91bEYjUEs7Sdzvu2ivgfqtpzlg42BZLlujDSRg0WLBvfZ_oD4V7cTx2o6MVr4oAdeHaK0wttPMQ85GMMOkgM7xvbHFcwXUG4MCr8JXX16S-OV2CS4ikQ286DOHPtBotbM7pqFTvIM", "Einkaufsliste " + req.body.name + " wurde erstellt!", req.body.description)
 | 
					        sendPush("enG4tJ6LyyU:APA91bEYjUEs7Sdzvu2ivgfqtpzlg42BZLlujDSRg0WLBvfZ_oD4V7cTx2o6MVr4oAdeHaK0wttPMQ85GMMOkgM7xvbHFcwXUG4MCr8JXX16S-OV2CS4ikQ286DOHPtBotbM7pqFTvIM", "Einkaufsliste " + req.body.name + " wurde erstellt!", req.body.description)
 | 
				
			||||||
      }
 | 
					      } catch (err) {
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
      catch(err) {
 | 
					 | 
				
			||||||
        res.status(400).send(await err);
 | 
					        res.status(400).send(await err);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }).catch(function (error) {
 | 
					    }).catch(function (error) {
 | 
				
			||||||
@@ -190,9 +170,7 @@ router.get("/shoppinglist_json/:sl_id", async (req, res) => {
 | 
				
			|||||||
      console.log("UID: ", uid);
 | 
					      console.log("UID: ", uid);
 | 
				
			||||||
      try {
 | 
					      try {
 | 
				
			||||||
        res.status(200).send(await postgres.displayShoppinglist(req.params.sl_id));
 | 
					        res.status(200).send(await postgres.displayShoppinglist(req.params.sl_id));
 | 
				
			||||||
      }
 | 
					      } catch (err) {
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
      catch(err) {
 | 
					 | 
				
			||||||
        res.status(400).send(await err);
 | 
					        res.status(400).send(await err);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }).catch(function (error) {
 | 
					    }).catch(function (error) {
 | 
				
			||||||
@@ -210,10 +188,7 @@ postgres.displayShoppinglist("4tezJYMK");
 | 
				
			|||||||
router.delete("/shoppinglist", async (req, res) => {
 | 
					router.delete("/shoppinglist", async (req, res) => {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    res.status(200).send(await postgres.deleteShoppinglist(req.body.sl_id));
 | 
					    res.status(200).send(await postgres.deleteShoppinglist(req.body.sl_id));
 | 
				
			||||||
    sendPush("enG4tJ6LyyU:APA91bEYjUEs7Sdzvu2ivgfqtpzlg42BZLlujDSRg0WLBvfZ_oD4V7cTx2o6MVr4oAdeHaK0wttPMQ85GMMOkgM7xvbHFcwXUG4MCr8JXX16S-OV2CS4ikQ286DOHPtBotbM7pqFTvIM", "Die Einkaufsliste " + req.body.sl_id + " wurde gelöscht!", "Einkaufsliste wurde geändert")
 | 
					  } catch (err) {
 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  catch(err) {
 | 
					 | 
				
			||||||
    res.status(400).send(await err);
 | 
					    res.status(400).send(await err);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
@@ -223,9 +198,7 @@ router.delete("/shoppinglist", async (req, res) => {
 | 
				
			|||||||
router.post("/group", async (req, res) => {
 | 
					router.post("/group", async (req, res) => {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    res.status(200).send(await postgres.addGroup(req.body.sl_id, req.body.name, req.body.color, req.body.hidden));
 | 
					    res.status(200).send(await postgres.addGroup(req.body.sl_id, req.body.name, req.body.color, req.body.hidden));
 | 
				
			||||||
  }
 | 
					  } catch (err) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
  catch(err) {
 | 
					 | 
				
			||||||
    res.status(400).send(await err);
 | 
					    res.status(400).send(await err);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -236,9 +209,7 @@ router.post("/group", async (req, res) => {
 | 
				
			|||||||
router.post("/item", async (req, res) => {
 | 
					router.post("/item", async (req, res) => {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    res.status(200).send(await postgres.addItem(req.body.group_id, req.body.sl_id, req.body.name, req.body.count));
 | 
					    res.status(200).send(await postgres.addItem(req.body.group_id, req.body.sl_id, req.body.name, req.body.count));
 | 
				
			||||||
  }
 | 
					  } catch (err) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
  catch (err) {
 | 
					 | 
				
			||||||
    res.status(400).send(await err);
 | 
					    res.status(400).send(await err);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
@@ -263,9 +234,7 @@ router.get("/userinfo_json", (req, res) => {
 | 
				
			|||||||
router.put("/shoppinglist", async (req, res) => {
 | 
					router.put("/shoppinglist", async (req, res) => {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    res.status(200).send(await postgres.editShoppinglist(req.body.sl_id, req.body.name, req.body.description, req.body.color));
 | 
					    res.status(200).send(await postgres.editShoppinglist(req.body.sl_id, req.body.name, req.body.description, req.body.color));
 | 
				
			||||||
  }
 | 
					  } catch (err) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
  catch(err) {
 | 
					 | 
				
			||||||
    res.status(400).send(await err);
 | 
					    res.status(400).send(await err);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
@@ -275,9 +244,7 @@ router.put("/shoppinglist", async (req, res) => {
 | 
				
			|||||||
router.put("/group", async (req, res) => {
 | 
					router.put("/group", async (req, res) => {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    res.status(200).send(await postgres.editGroup(req.body.sl_id, req.body.group_id, req.body.name, req.body.color, req.body.hidden));
 | 
					    res.status(200).send(await postgres.editGroup(req.body.sl_id, req.body.group_id, req.body.name, req.body.color, req.body.hidden));
 | 
				
			||||||
  }
 | 
					  } catch (err) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
  catch(err) {
 | 
					 | 
				
			||||||
    res.status(400).send(await err);
 | 
					    res.status(400).send(await err);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
@@ -285,9 +252,7 @@ router.put("/group", async (req, res) => {
 | 
				
			|||||||
router.put("/item", async (req, res) => {
 | 
					router.put("/item", async (req, res) => {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    res.status(200).send(await postgres.editItem(req.body.sl_id, req.body.group_id, req.body.item_id, req.body.name, req.body.count));
 | 
					    res.status(200).send(await postgres.editItem(req.body.sl_id, req.body.group_id, req.body.item_id, req.body.name, req.body.count));
 | 
				
			||||||
  }
 | 
					  } catch (err) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
  catch(err) {
 | 
					 | 
				
			||||||
    res.status(400).send(await err);
 | 
					    res.status(400).send(await err);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
@@ -295,9 +260,7 @@ router.put("/item", async (req, res) => {
 | 
				
			|||||||
router.delete("/group", async (req, res) => {
 | 
					router.delete("/group", async (req, res) => {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    res.status(200).send(await postgres.deleteGroup(req.body.group_id, req.body.sl_id));
 | 
					    res.status(200).send(await postgres.deleteGroup(req.body.group_id, req.body.sl_id));
 | 
				
			||||||
  }
 | 
					  } catch (err) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
  catch(err) {
 | 
					 | 
				
			||||||
    res.status(400).send(await err);
 | 
					    res.status(400).send(await err);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
@@ -305,9 +268,7 @@ router.delete("/group", async(req, res) => {
 | 
				
			|||||||
router.delete("/item", async (req, res) => {
 | 
					router.delete("/item", async (req, res) => {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    res.status(200).send(await postgres.deleteItem(req.body.item_id, req.body.group.id, req.body.sl_id));
 | 
					    res.status(200).send(await postgres.deleteItem(req.body.item_id, req.body.group.id, req.body.sl_id));
 | 
				
			||||||
  }
 | 
					  } catch (err) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
  catch(err) {
 | 
					 | 
				
			||||||
    res.status(400).send(await err);
 | 
					    res.status(400).send(await err);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
@@ -317,9 +278,7 @@ router.delete("/item", async(req, res) => {
 | 
				
			|||||||
router.post("/invite", async (req, res) => {
 | 
					router.post("/invite", async (req, res) => {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    res.status(200).send(await postgres.createInvite(req.body.sl_id));
 | 
					    res.status(200).send(await postgres.createInvite(req.body.sl_id));
 | 
				
			||||||
  }
 | 
					  } catch (err) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
  catch(err) {
 | 
					 | 
				
			||||||
    res.status(400).send(await err);
 | 
					    res.status(400).send(await err);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
@@ -327,9 +286,7 @@ router.post("/invite", async (req, res) => {
 | 
				
			|||||||
router.post("/maninvite", async (req, res) => {
 | 
					router.post("/maninvite", async (req, res) => {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    res.status(200).send(await postgres.manInvite(req.body.sl_id, req.body.uid));
 | 
					    res.status(200).send(await postgres.manInvite(req.body.sl_id, req.body.uid));
 | 
				
			||||||
  }
 | 
					  } catch (err) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
  catch(err) {
 | 
					 | 
				
			||||||
    res.status(400).send(err);
 | 
					    res.status(400).send(err);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -339,9 +296,7 @@ router.post("/maninvite", async (req, res) => {
 | 
				
			|||||||
router.delete("/member", (req, res) => {
 | 
					router.delete("/member", (req, res) => {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    postgres.removeMember(req.body.uid, req.body.sl_id)
 | 
					    postgres.removeMember(req.body.uid, req.body.sl_id)
 | 
				
			||||||
  }
 | 
					  } catch (err) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
  catch(err) {
 | 
					 | 
				
			||||||
    return err;
 | 
					    return err;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
@@ -361,9 +316,7 @@ router.post("/invitemember", (req, res) => {
 | 
				
			|||||||
      try {
 | 
					      try {
 | 
				
			||||||
        console.log("Route LInk inv", req.body.link);
 | 
					        console.log("Route LInk inv", req.body.link);
 | 
				
			||||||
        res.status(200).send(await postgres.verifyInvite(req.body.link, uid));
 | 
					        res.status(200).send(await postgres.verifyInvite(req.body.link, uid));
 | 
				
			||||||
      }
 | 
					      } catch (err) {
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
      catch(err) {
 | 
					 | 
				
			||||||
        res.status(400).send(await err);
 | 
					        res.status(400).send(await err);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }).catch(function (error) {
 | 
					    }).catch(function (error) {
 | 
				
			||||||
@@ -386,9 +339,7 @@ router.post("/user", async function(req, res, next) {
 | 
				
			|||||||
      try {
 | 
					      try {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        res.status(200).send(await postgres.updateUser(uid, req.body.message_id, decodedToken.name, decodedToken.picture, decodedToken.email));
 | 
					        res.status(200).send(await postgres.updateUser(uid, req.body.message_id, decodedToken.name, decodedToken.picture, decodedToken.email));
 | 
				
			||||||
      }
 | 
					      } catch (err) {
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
      catch(err) {
 | 
					 | 
				
			||||||
        res.status(400).send(await err);
 | 
					        res.status(400).send(await err);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }).catch(function (error) {
 | 
					    }).catch(function (error) {
 | 
				
			||||||
@@ -399,9 +350,7 @@ router.post("/user", async function(req, res, next) {
 | 
				
			|||||||
router.get("/users", async (req, res) => {
 | 
					router.get("/users", async (req, res) => {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    res.status(200).send(await postgres.searchUsers(req.query.search));
 | 
					    res.status(200).send(await postgres.searchUsers(req.query.search));
 | 
				
			||||||
  }
 | 
					  } catch (err) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
  catch(err) {
 | 
					 | 
				
			||||||
    res.status(400).send(err);
 | 
					    res.status(400).send(err);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -421,9 +370,7 @@ router.post("/donepurchases", (req, res) => {
 | 
				
			|||||||
      uid = decodedToken.uid;
 | 
					      uid = decodedToken.uid;
 | 
				
			||||||
      try {
 | 
					      try {
 | 
				
			||||||
        console.log("test");
 | 
					        console.log("test");
 | 
				
			||||||
      }
 | 
					      } catch (err) {
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
      catch(err) {
 | 
					 | 
				
			||||||
        console.error(error);
 | 
					        console.error(error);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }).catch(async function (error) {
 | 
					    }).catch(async function (error) {
 | 
				
			||||||
@@ -442,9 +389,7 @@ router.get("/donepurchases", (req, res) => {
 | 
				
			|||||||
      uid = decodedToken.uid;
 | 
					      uid = decodedToken.uid;
 | 
				
			||||||
      try {
 | 
					      try {
 | 
				
			||||||
        res.status(200).send(await postgres.getDonePurchases(uid));
 | 
					        res.status(200).send(await postgres.getDonePurchases(uid));
 | 
				
			||||||
      }
 | 
					      } catch (err) {
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
      catch(err) {
 | 
					 | 
				
			||||||
        res.status(400).send(await err);
 | 
					        res.status(400).send(await err);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }).catch(async function (error) {
 | 
					    }).catch(async function (error) {
 | 
				
			||||||
@@ -475,9 +420,7 @@ router.post("/dones", async function(req, res, next) {
 | 
				
			|||||||
      try {
 | 
					      try {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        res.status(200).send(await postgres.moveDoneItems(uid, req.body.sl_id, req.body.billcontent));
 | 
					        res.status(200).send(await postgres.moveDoneItems(uid, req.body.sl_id, req.body.billcontent));
 | 
				
			||||||
      }
 | 
					      } catch (err) {
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
      catch(err) {
 | 
					 | 
				
			||||||
        res.status(400).send(await err);
 | 
					        res.status(400).send(await err);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }).catch(function (error) {
 | 
					    }).catch(function (error) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,13 +1,15 @@
 | 
				
			|||||||
#!/usr/bin/env node
 | 
					#!/usr/bin/env node
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var Greenlock = require('../');
 | 
					var Greenlock = require('../');
 | 
				
			||||||
var greenlock = Greenlock.create({
 | 
					var greenlock = Greenlock.create({
 | 
				
			||||||
  version: 'draft-11'
 | 
					  version: 'draft-11',
 | 
				
			||||||
, server: 'https://acme-staging-v02.api.letsencrypt.org/directory'
 | 
					  server: 'https://acme-staging-v02.api.letsencrypt.org/directory',
 | 
				
			||||||
, agreeTos: true
 | 
					  agreeTos: true,
 | 
				
			||||||
, approvedDomains: [ 'example.com', 'www.example.com' ]
 | 
					  approvedDomains: ['example.com', 'www.example.com'],
 | 
				
			||||||
, configDir: require('path').join(require('os').tmpdir(), 'acme')
 | 
					  configDir: require('path').join(require('os').tmpdir(), 'acme')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
, app: require('express')().use('/', function (req, res) {
 | 
					    ,
 | 
				
			||||||
 | 
					  app: require('express')().use('/', function (req, res) {
 | 
				
			||||||
    res.setHeader('Content-Type', 'text/html; charset=utf-8');
 | 
					    res.setHeader('Content-Type', 'text/html; charset=utf-8');
 | 
				
			||||||
    res.end('Hello, World!\n\n💚 🔒.js');
 | 
					    res.end('Hello, World!\n\n💚 🔒.js');
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,36 +0,0 @@
 | 
				
			|||||||
 | 
					 | 
				
			||||||
<script src="https://www.gstatic.com/firebasejs/5.7.0/firebase.js"></script>
 | 
					 | 
				
			||||||
 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<script >
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // Initialize Firebase
 | 
					 | 
				
			||||||
    var config = {
 | 
					 | 
				
			||||||
        apiKey: "AIzaSyCuvwf78cmSDoZ2yS4XxHZhnjUn7yIHYfw",
 | 
					 | 
				
			||||||
        authDomain: "test-667ca.firebaseapp.com",
 | 
					 | 
				
			||||||
        databaseURL: "https://test-667ca.firebaseio.com",
 | 
					 | 
				
			||||||
        projectId: "test-667ca",
 | 
					 | 
				
			||||||
        storageBucket: "test-667ca.appspot.com",
 | 
					 | 
				
			||||||
        messagingSenderId: "221332577314"
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
    firebase.initializeApp(config);
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    console.log("EJS TEst: ", "<%= customtoken%>")
 | 
					 | 
				
			||||||
    firebase.auth().signInWithCustomToken("<%= customtoken%>").then(function(response){
 | 
					 | 
				
			||||||
        firebase.auth().getIdToken(/* forceRefresh */ ).then(function(idToken) {
 | 
					 | 
				
			||||||
           console.log("IDTOKEN: ", idToken)
 | 
					 | 
				
			||||||
          window.location.replace('/dash/'+ idToken);
 | 
					 | 
				
			||||||
        }).catch(function(error) {
 | 
					 | 
				
			||||||
          console.error("token error: ", error)
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
      }).catch(function(error) {
 | 
					 | 
				
			||||||
        // Handle Errors here.
 | 
					 | 
				
			||||||
        var errorCode = error.code;
 | 
					 | 
				
			||||||
        var errorMessage = error.message;
 | 
					 | 
				
			||||||
        console.error("Custom token error: ", error.message)
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    </script>
 | 
					 | 
				
			||||||
@@ -1,15 +1,18 @@
 | 
				
			|||||||
<!DOCTYPE html>
 | 
					<!DOCTYPE html>
 | 
				
			||||||
<html>
 | 
					<html>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<head>
 | 
					<head>
 | 
				
			||||||
    <title></title>
 | 
					    <title></title>
 | 
				
			||||||
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
 | 
					    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
 | 
				
			||||||
    <link rel='stylesheet' href='/stylesheets/style.css'>
 | 
					    <link rel='stylesheet' href='/stylesheets/style.css'>
 | 
				
			||||||
    <link rel='stylesheet' href='/stylesheets/colorpicker-style.css'>
 | 
					    <link rel='stylesheet' href='/stylesheets/colorpicker-style.css'>
 | 
				
			||||||
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
 | 
					    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU"
 | 
				
			||||||
 | 
					        crossorigin="anonymous">
 | 
				
			||||||
    <link rel='stylesheet' href='/bootstrap/dist/css/bootstrap.min.css'>
 | 
					    <link rel='stylesheet' href='/bootstrap/dist/css/bootstrap.min.css'>
 | 
				
			||||||
    <script src="https://www.gstatic.com/firebasejs/5.7.0/firebase.js"></script>
 | 
					    <script src="https://www.gstatic.com/firebasejs/5.7.0/firebase.js"></script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</head>
 | 
					</head>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<body id="vue-app">
 | 
					<body id="vue-app">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <!-- Navbar -->
 | 
					    <!-- Navbar -->
 | 
				
			||||||
@@ -22,7 +25,8 @@
 | 
				
			|||||||
        <ul class="nav justify-content-end liste">
 | 
					        <ul class="nav justify-content-end liste">
 | 
				
			||||||
            <li class="nav-item">
 | 
					            <li class="nav-item">
 | 
				
			||||||
                <!-- <a class="nav-link active" href="#">Add</a> -->
 | 
					                <!-- <a class="nav-link active" href="#">Add</a> -->
 | 
				
			||||||
              <button class="btn btn-outline-light border-secondary sl_add" style="color: black">Shoppingliste Hinzufügen</button>
 | 
					                <button class="btn btn-outline-light border-secondary sl_add" style="color: black">Shoppingliste
 | 
				
			||||||
 | 
					                    Hinzufügen</button>
 | 
				
			||||||
            </li>
 | 
					            </li>
 | 
				
			||||||
        </ul>
 | 
					        </ul>
 | 
				
			||||||
        <!-- <a href="/logout"> -->
 | 
					        <!-- <a href="/logout"> -->
 | 
				
			||||||
@@ -56,12 +60,15 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <!-- Modal Group Hinzufügen -->
 | 
					    <!-- Modal Group Hinzufügen -->
 | 
				
			||||||
    <div class="modal fade bd-example-modal-sm ListenDetailAdd" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
 | 
					    <div class="modal fade bd-example-modal-sm ListenDetailAdd" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"
 | 
				
			||||||
 | 
					        aria-hidden="true">
 | 
				
			||||||
        <div class="modal-dialog modal-sm">
 | 
					        <div class="modal-dialog modal-sm">
 | 
				
			||||||
            <div class="modal-content">
 | 
					            <div class="modal-content">
 | 
				
			||||||
                <div>
 | 
					                <div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    <center><p class="layout ueberschrift">Group hinzufügen</p></center>
 | 
					                    <center>
 | 
				
			||||||
 | 
					                        <p class="layout ueberschrift">Group hinzufügen</p>
 | 
				
			||||||
 | 
					                    </center>
 | 
				
			||||||
                    <div class="form-group layout">
 | 
					                    <div class="form-group layout">
 | 
				
			||||||
                        <label for="exampleInputEmail1">Name</label>
 | 
					                        <label for="exampleInputEmail1">Name</label>
 | 
				
			||||||
                        <input type="text" class="form-control" id="groupname" placeholder="zB: Getränke">
 | 
					                        <input type="text" class="form-control" id="groupname" placeholder="zB: Getränke">
 | 
				
			||||||
@@ -122,12 +129,15 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <!-- Modal Item Hinzufügen -->
 | 
					    <!-- Modal Item Hinzufügen -->
 | 
				
			||||||
    <div class="modal fade bd-example-modal-sm GroupItemAdd" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
 | 
					    <div class="modal fade bd-example-modal-sm GroupItemAdd" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"
 | 
				
			||||||
 | 
					        aria-hidden="true">
 | 
				
			||||||
        <div class="modal-dialog modal-sm">
 | 
					        <div class="modal-dialog modal-sm">
 | 
				
			||||||
            <div class="modal-content">
 | 
					            <div class="modal-content">
 | 
				
			||||||
                <div class="inhalt">
 | 
					                <div class="inhalt">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    <center><p class="layout ueberschrift">Item hinzufügen</p></center>
 | 
					                    <center>
 | 
				
			||||||
 | 
					                        <p class="layout ueberschrift">Item hinzufügen</p>
 | 
				
			||||||
 | 
					                    </center>
 | 
				
			||||||
                    <div class="form-group layout">
 | 
					                    <div class="form-group layout">
 | 
				
			||||||
                        <label for="exampleInputEmail1">Gegenstand</label>
 | 
					                        <label for="exampleInputEmail1">Gegenstand</label>
 | 
				
			||||||
                        <input type="text" class="form-control" id="itemname" placeholder="zB: Coca Cola">
 | 
					                        <input type="text" class="form-control" id="itemname" placeholder="zB: Coca Cola">
 | 
				
			||||||
@@ -158,7 +168,8 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <!-- Modal Shoppingliste Hinzufügen -->
 | 
					    <!-- Modal Shoppingliste Hinzufügen -->
 | 
				
			||||||
    <div class="modal fade bd-example-modal-sm EigeneListeAdd" tabindex="-1" id="EigeneListeAdd" role="dialog" aria-labelledby="EigeneListeAdd" aria-hidden="true">
 | 
					    <div class="modal fade bd-example-modal-sm EigeneListeAdd" tabindex="-1" id="EigeneListeAdd" role="dialog"
 | 
				
			||||||
 | 
					        aria-labelledby="EigeneListeAdd" aria-hidden="true">
 | 
				
			||||||
        <div class="modal-dialog modal-sm">
 | 
					        <div class="modal-dialog modal-sm">
 | 
				
			||||||
            <div class="modal-content">
 | 
					            <div class="modal-content">
 | 
				
			||||||
                <div>
 | 
					                <div>
 | 
				
			||||||
@@ -241,4 +252,5 @@
 | 
				
			|||||||
    <script src="/javascripts/test.js"></script>
 | 
					    <script src="/javascripts/test.js"></script>
 | 
				
			||||||
    <script src="/javascripts/firebase-app.js"></script>
 | 
					    <script src="/javascripts/firebase-app.js"></script>
 | 
				
			||||||
</body>
 | 
					</body>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</html>
 | 
					</html>
 | 
				
			||||||
@@ -1,3 +1,7 @@
 | 
				
			|||||||
<h1><%= message %></h1>
 | 
					<h1>
 | 
				
			||||||
<h2><%= error.status %></h2>
 | 
					    <%= message %>
 | 
				
			||||||
 | 
					</h1>
 | 
				
			||||||
 | 
					<h2>
 | 
				
			||||||
 | 
					    <%= error.status %>
 | 
				
			||||||
 | 
					</h2>
 | 
				
			||||||
<pre><%= error.stack %></pre>
 | 
					<pre><%= error.stack %></pre>
 | 
				
			||||||
@@ -1,5 +1,6 @@
 | 
				
			|||||||
<!DOCTYPE html>
 | 
					<!DOCTYPE html>
 | 
				
			||||||
<html>
 | 
					<html>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<head>
 | 
					<head>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <link rel='stylesheet' href='/stylesheets/style.css' />
 | 
					  <link rel='stylesheet' href='/stylesheets/style.css' />
 | 
				
			||||||
@@ -8,10 +9,17 @@
 | 
				
			|||||||
  <script src="https://www.gstatic.com/firebasejs/5.7.0/firebase.js"></script>
 | 
					  <script src="https://www.gstatic.com/firebasejs/5.7.0/firebase.js"></script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</head>
 | 
					</head>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<body>
 | 
					<body>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <div id='vue-app'>
 | 
					  <div id='vue-app'>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <input v-model="email" id="email" type="email">
 | 
				
			||||||
 | 
					    <input v-model="password" id="password" type="password">
 | 
				
			||||||
 | 
					    <button id="loginemailbutton" @click="loginemail()">Login with Email</button>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    {{email}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <button id="loginbutton" @click="login()">Login with google</button>
 | 
					    <button id="loginbutton" @click="login()">Login with google</button>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -19,4 +27,5 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</body>
 | 
					</body>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</html>
 | 
					</html>
 | 
				
			||||||
@@ -1,5 +1,6 @@
 | 
				
			|||||||
<!DOCTYPE html>
 | 
					<!DOCTYPE html>
 | 
				
			||||||
<html lang="en">
 | 
					<html lang="en">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<head>
 | 
					<head>
 | 
				
			||||||
    <meta charset="UTF-8">
 | 
					    <meta charset="UTF-8">
 | 
				
			||||||
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
 | 
					    <meta name="viewport" content="width=device-width, initial-scale=1.0">
 | 
				
			||||||
@@ -29,6 +30,7 @@
 | 
				
			|||||||
    <!-- Compiled and minified JavaScript -->
 | 
					    <!-- Compiled and minified JavaScript -->
 | 
				
			||||||
    <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
 | 
					    <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
 | 
				
			||||||
</head>
 | 
					</head>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<body>
 | 
					<body>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -54,4 +56,5 @@
 | 
				
			|||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</body>
 | 
					</body>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</html>
 | 
					</html>
 | 
				
			||||||
@@ -58,7 +58,8 @@
 | 
				
			|||||||
      <center><img id="blah" src="#" alt="" /></center>
 | 
					      <center><img id="blah" src="#" alt="" /></center>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      <center><button class="btn waves-effect waves-light deep-orange darken-1 disabled btn-analyze " type="submit" name="action">Continue<i class="material-icons right">send</i></button></center>
 | 
					    <center><button class="btn waves-effect waves-light deep-orange darken-1 disabled btn-analyze " type="submit" name="action">Continue<i
 | 
				
			||||||
 | 
					          class="material-icons right">send</i></button></center>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -76,13 +77,16 @@
 | 
				
			|||||||
  <div id="modal1" class="modal">
 | 
					  <div id="modal1" class="modal">
 | 
				
			||||||
    <div class="modal-content">
 | 
					    <div class="modal-content">
 | 
				
			||||||
      <h4>Choose Shoppinglist</h4>
 | 
					      <h4>Choose Shoppinglist</h4>
 | 
				
			||||||
      <center>  <div class="preloader-wrapper big active">
 | 
					      <center>
 | 
				
			||||||
 | 
					        <div class="preloader-wrapper big active">
 | 
				
			||||||
          <div class="spinner-layer spinner-blue-only">
 | 
					          <div class="spinner-layer spinner-blue-only">
 | 
				
			||||||
            <div class="circle-clipper left">
 | 
					            <div class="circle-clipper left">
 | 
				
			||||||
              <div class="circle"></div>
 | 
					              <div class="circle"></div>
 | 
				
			||||||
            </div><div class="gap-patch">
 | 
					            </div>
 | 
				
			||||||
 | 
					            <div class="gap-patch">
 | 
				
			||||||
              <div class="circle"></div>
 | 
					              <div class="circle"></div>
 | 
				
			||||||
            </div><div class="circle-clipper right">
 | 
					            </div>
 | 
				
			||||||
 | 
					            <div class="circle-clipper right">
 | 
				
			||||||
              <div class="circle"></div>
 | 
					              <div class="circle"></div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
@@ -126,7 +130,8 @@
 | 
				
			|||||||
  <!-- Modal Structure PRELOADER END-->
 | 
					  <!-- Modal Structure PRELOADER END-->
 | 
				
			||||||
  <div id="modalEND" class="modal">
 | 
					  <div id="modalEND" class="modal">
 | 
				
			||||||
    <div class="modal-content">
 | 
					    <div class="modal-content">
 | 
				
			||||||
        <center>    <div class="progress">
 | 
					      <center>
 | 
				
			||||||
 | 
					        <div class="progress">
 | 
				
			||||||
          <div class="indeterminate"></div>
 | 
					          <div class="indeterminate"></div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user