Using lorem picsum for default images on the site.

This commit is contained in:
Bradley Shellnut 2022-01-10 17:14:30 -08:00
parent 28dfcd45db
commit 5971fd1b6b
12 changed files with 196 additions and 84 deletions

View file

@ -11,7 +11,7 @@ export default function HomeContent() {
return ( return (
<HomeStyles> <HomeStyles>
<CustomNextImage <CustomNextImage
src="https://via.placeholder.com/800X1307.png" src="https://picsum.photos/1307/880"
height={880} height={880}
width={1307} width={1307}
alt="Picture of Name and Name" alt="Picture of Name and Name"

View file

@ -1,13 +1,14 @@
// this file is a wrapper with defaults to be used in both API routes and `getServerSideProps` functions // this file is a wrapper with defaults to be used in both API routes and `getServerSideProps` functions
import { withIronSession } from 'next-iron-session'; import { withIronSessionApiRoute } from 'iron-session/next';
export default function withSession(handler) { export default function withSession(handler) {
return withIronSession(handler, { return withIronSessionApiRoute(handler, {
password: process.env.SECRET_COOKIE_PASSWORD, password: process.env.SECRET_COOKIE_PASSWORD,
cookieName: 'weddingwebsitesession', cookieName: 'weddingwebsitesession',
cookieOptions: { cookieOptions: {
// the next line allows to use the session in non-https environments like // the next line allows to use the session in non-https environments like
// Next.js dev mode (http://localhost:3000) // Next.js dev mode (http://localhost:3000)
// maxAge default is 14 days
secure: process.env.NODE_ENV === 'production', secure: process.env.NODE_ENV === 'production',
}, },
}); });

View file

@ -1,5 +1,5 @@
module.exports = { module.exports = {
images: { images: {
domains: ['res.cloudinary.com', 'via.placeholder.com'], domains: ['res.cloudinary.com', 'via.placeholder.com', 'picsum.photos'],
}, },
}; };

212
package-lock.json generated
View file

@ -17,11 +17,11 @@
"cloudinary-build-url": "^0.2.1", "cloudinary-build-url": "^0.2.1",
"dotenv": "^10.0.0", "dotenv": "^10.0.0",
"escape-html": "^1.0.3", "escape-html": "^1.0.3",
"iron-session": "^6.0.5",
"jsonwebtoken": "^8.5.1", "jsonwebtoken": "^8.5.1",
"mongodb": "^4.3.0", "mongodb": "^4.3.0",
"mongoose": "^6.1.5", "mongoose": "^6.1.5",
"next": "^12.0.7", "next": "^12.0.7",
"next-iron-session": "^4.2.0",
"next-with-apollo": "^5.2.1", "next-with-apollo": "^5.2.1",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
@ -2319,11 +2319,49 @@
"react-dom": "^16.8.0 || 17.x" "react-dom": "^16.8.0 || 17.x"
} }
}, },
"node_modules/@types/body-parser": {
"version": "1.19.2",
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz",
"integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==",
"dependencies": {
"@types/connect": "*",
"@types/node": "*"
}
},
"node_modules/@types/connect": {
"version": "3.4.35",
"resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz",
"integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==",
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/cookie": { "node_modules/@types/cookie": {
"version": "0.4.1", "version": "0.4.1",
"resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz",
"integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==" "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q=="
}, },
"node_modules/@types/express": {
"version": "4.17.13",
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz",
"integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==",
"dependencies": {
"@types/body-parser": "*",
"@types/express-serve-static-core": "^4.17.18",
"@types/qs": "*",
"@types/serve-static": "*"
}
},
"node_modules/@types/express-serve-static-core": {
"version": "4.17.27",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.27.tgz",
"integrity": "sha512-e/sVallzUTPdyOTiqi8O8pMdBBphscvI6E4JYaKlja4Lm+zh7UFSSdW5VMkRbhDtmrONqOUHOXRguPsDckzxNA==",
"dependencies": {
"@types/node": "*",
"@types/qs": "*",
"@types/range-parser": "*"
}
},
"node_modules/@types/json-schema": { "node_modules/@types/json-schema": {
"version": "7.0.9", "version": "7.0.9",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz",
@ -2336,11 +2374,35 @@
"integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=",
"dev": true "dev": true
}, },
"node_modules/@types/mime": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz",
"integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw=="
},
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "16.11.19", "version": "16.11.19",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.19.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.19.tgz",
"integrity": "sha512-BPAcfDPoHlRQNKktbsbnpACGdypPFBuX4xQlsWDE7B8XXcfII+SpOLay3/qZmCLb39kV5S1RTYwXdkx2lwLYng==" "integrity": "sha512-BPAcfDPoHlRQNKktbsbnpACGdypPFBuX4xQlsWDE7B8XXcfII+SpOLay3/qZmCLb39kV5S1RTYwXdkx2lwLYng=="
}, },
"node_modules/@types/qs": {
"version": "6.9.7",
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz",
"integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw=="
},
"node_modules/@types/range-parser": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz",
"integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw=="
},
"node_modules/@types/serve-static": {
"version": "1.13.10",
"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz",
"integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==",
"dependencies": {
"@types/mime": "^1",
"@types/node": "*"
}
},
"node_modules/@types/webidl-conversions": { "node_modules/@types/webidl-conversions": {
"version": "6.1.1", "version": "6.1.1",
"resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-6.1.1.tgz", "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-6.1.1.tgz",
@ -2711,6 +2773,7 @@
"version": "1.2.5", "version": "1.2.5",
"resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz",
"integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==", "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==",
"dev": true,
"dependencies": { "dependencies": {
"call-bind": "^1.0.2", "call-bind": "^1.0.2",
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
@ -3469,14 +3532,6 @@
"resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.6.tgz", "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.6.tgz",
"integrity": "sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==" "integrity": "sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q=="
}, },
"node_modules/clone": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
"integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=",
"engines": {
"node": ">=0.8"
}
},
"node_modules/cloudinary-build-url": { "node_modules/cloudinary-build-url": {
"version": "0.2.1", "version": "0.2.1",
"resolved": "https://registry.npmjs.org/cloudinary-build-url/-/cloudinary-build-url-0.2.1.tgz", "resolved": "https://registry.npmjs.org/cloudinary-build-url/-/cloudinary-build-url-0.2.1.tgz",
@ -5406,13 +5461,31 @@
"resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz",
"integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo="
}, },
"node_modules/iron-store": { "node_modules/iron-session": {
"version": "1.3.5", "version": "6.0.5",
"resolved": "https://registry.npmjs.org/iron-store/-/iron-store-1.3.5.tgz", "resolved": "https://registry.npmjs.org/iron-session/-/iron-session-6.0.5.tgz",
"integrity": "sha512-3RBkmVA6AZ3jezmLeX5H0lX1yS3fa90MFU9pL9vyhbpzXCRgAS7DLAfERXDPJEkT3jMZfxnVTTUwwfpB85ml7w==", "integrity": "sha512-sxkymaQzPkgUnDRfxxstm4jKCKx+ElrdPKzk+uJWj98zk9EPBPHPMg4jJgd+p0ucj631bbrRL9Bjc+XTwxUzeg==",
"dependencies": { "dependencies": {
"@hapi/iron": "^6.0.0", "@hapi/iron": "^6.0.0",
"clone": "^2.1.2" "@types/cookie": "^0.4.0",
"@types/express": "^4.17.13",
"@types/node": "^16.11.7",
"cookie": "^0.4.1"
},
"engines": {
"node": ">=12"
},
"peerDependencies": {
"express": ">=4",
"next": ">=10"
},
"peerDependenciesMeta": {
"express": {
"optional": true
},
"next": {
"optional": true
}
} }
}, },
"node_modules/is-arguments": { "node_modules/is-arguments": {
@ -6309,23 +6382,6 @@
} }
} }
}, },
"node_modules/next-iron-session": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/next-iron-session/-/next-iron-session-4.2.0.tgz",
"integrity": "sha512-RzdbAmB77HJYXPdWrOjsPPE/b6yiSDAwhXEnX5z6mSYUMh22vR1iJD/CeBjs3FWxL39qO78CsLtIjpcojFz4DA==",
"deprecated": "Nov 2021 update: The library was renamed to iron-session and fully rewritten in TypeScript, it includes lots of new features and fixes. Follow the migration guide here: https://github.com/vvo/iron-session/releases/tag/v6.0.0. Existing sessions will be kept when upgrading. Thanks for using iron-session :).",
"dependencies": {
"@types/cookie": "^0.4.0",
"array.prototype.flat": "^1.2.4",
"clone": "^2.1.2",
"cookie": "^0.4.1",
"debug": "^4.3.1",
"iron-store": "^1.3.0"
},
"engines": {
"node": ">=0.11.0"
}
},
"node_modules/next-with-apollo": { "node_modules/next-with-apollo": {
"version": "5.2.1", "version": "5.2.1",
"resolved": "https://registry.npmjs.org/next-with-apollo/-/next-with-apollo-5.2.1.tgz", "resolved": "https://registry.npmjs.org/next-with-apollo/-/next-with-apollo-5.2.1.tgz",
@ -9825,11 +9881,49 @@
"tslib": "^2.3.0" "tslib": "^2.3.0"
} }
}, },
"@types/body-parser": {
"version": "1.19.2",
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz",
"integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==",
"requires": {
"@types/connect": "*",
"@types/node": "*"
}
},
"@types/connect": {
"version": "3.4.35",
"resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz",
"integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==",
"requires": {
"@types/node": "*"
}
},
"@types/cookie": { "@types/cookie": {
"version": "0.4.1", "version": "0.4.1",
"resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz",
"integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==" "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q=="
}, },
"@types/express": {
"version": "4.17.13",
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz",
"integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==",
"requires": {
"@types/body-parser": "*",
"@types/express-serve-static-core": "^4.17.18",
"@types/qs": "*",
"@types/serve-static": "*"
}
},
"@types/express-serve-static-core": {
"version": "4.17.27",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.27.tgz",
"integrity": "sha512-e/sVallzUTPdyOTiqi8O8pMdBBphscvI6E4JYaKlja4Lm+zh7UFSSdW5VMkRbhDtmrONqOUHOXRguPsDckzxNA==",
"requires": {
"@types/node": "*",
"@types/qs": "*",
"@types/range-parser": "*"
}
},
"@types/json-schema": { "@types/json-schema": {
"version": "7.0.9", "version": "7.0.9",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz",
@ -9842,11 +9936,35 @@
"integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=",
"dev": true "dev": true
}, },
"@types/mime": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz",
"integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw=="
},
"@types/node": { "@types/node": {
"version": "16.11.19", "version": "16.11.19",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.19.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.19.tgz",
"integrity": "sha512-BPAcfDPoHlRQNKktbsbnpACGdypPFBuX4xQlsWDE7B8XXcfII+SpOLay3/qZmCLb39kV5S1RTYwXdkx2lwLYng==" "integrity": "sha512-BPAcfDPoHlRQNKktbsbnpACGdypPFBuX4xQlsWDE7B8XXcfII+SpOLay3/qZmCLb39kV5S1RTYwXdkx2lwLYng=="
}, },
"@types/qs": {
"version": "6.9.7",
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz",
"integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw=="
},
"@types/range-parser": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz",
"integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw=="
},
"@types/serve-static": {
"version": "1.13.10",
"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz",
"integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==",
"requires": {
"@types/mime": "^1",
"@types/node": "*"
}
},
"@types/webidl-conversions": { "@types/webidl-conversions": {
"version": "6.1.1", "version": "6.1.1",
"resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-6.1.1.tgz", "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-6.1.1.tgz",
@ -10083,6 +10201,7 @@
"version": "1.2.5", "version": "1.2.5",
"resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz",
"integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==", "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==",
"dev": true,
"requires": { "requires": {
"call-bind": "^1.0.2", "call-bind": "^1.0.2",
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
@ -10699,11 +10818,6 @@
"resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.6.tgz", "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.6.tgz",
"integrity": "sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==" "integrity": "sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q=="
}, },
"clone": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
"integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18="
},
"cloudinary-build-url": { "cloudinary-build-url": {
"version": "0.2.1", "version": "0.2.1",
"resolved": "https://registry.npmjs.org/cloudinary-build-url/-/cloudinary-build-url-0.2.1.tgz", "resolved": "https://registry.npmjs.org/cloudinary-build-url/-/cloudinary-build-url-0.2.1.tgz",
@ -12159,13 +12273,16 @@
"resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz",
"integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo="
}, },
"iron-store": { "iron-session": {
"version": "1.3.5", "version": "6.0.5",
"resolved": "https://registry.npmjs.org/iron-store/-/iron-store-1.3.5.tgz", "resolved": "https://registry.npmjs.org/iron-session/-/iron-session-6.0.5.tgz",
"integrity": "sha512-3RBkmVA6AZ3jezmLeX5H0lX1yS3fa90MFU9pL9vyhbpzXCRgAS7DLAfERXDPJEkT3jMZfxnVTTUwwfpB85ml7w==", "integrity": "sha512-sxkymaQzPkgUnDRfxxstm4jKCKx+ElrdPKzk+uJWj98zk9EPBPHPMg4jJgd+p0ucj631bbrRL9Bjc+XTwxUzeg==",
"requires": { "requires": {
"@hapi/iron": "^6.0.0", "@hapi/iron": "^6.0.0",
"clone": "^2.1.2" "@types/cookie": "^0.4.0",
"@types/express": "^4.17.13",
"@types/node": "^16.11.7",
"cookie": "^0.4.1"
} }
}, },
"is-arguments": { "is-arguments": {
@ -12885,19 +13002,6 @@
} }
} }
}, },
"next-iron-session": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/next-iron-session/-/next-iron-session-4.2.0.tgz",
"integrity": "sha512-RzdbAmB77HJYXPdWrOjsPPE/b6yiSDAwhXEnX5z6mSYUMh22vR1iJD/CeBjs3FWxL39qO78CsLtIjpcojFz4DA==",
"requires": {
"@types/cookie": "^0.4.0",
"array.prototype.flat": "^1.2.4",
"clone": "^2.1.2",
"cookie": "^0.4.1",
"debug": "^4.3.1",
"iron-store": "^1.3.0"
}
},
"next-with-apollo": { "next-with-apollo": {
"version": "5.2.1", "version": "5.2.1",
"resolved": "https://registry.npmjs.org/next-with-apollo/-/next-with-apollo-5.2.1.tgz", "resolved": "https://registry.npmjs.org/next-with-apollo/-/next-with-apollo-5.2.1.tgz",

View file

@ -18,11 +18,11 @@
"cloudinary-build-url": "^0.2.1", "cloudinary-build-url": "^0.2.1",
"dotenv": "^10.0.0", "dotenv": "^10.0.0",
"escape-html": "^1.0.3", "escape-html": "^1.0.3",
"iron-session": "^6.0.5",
"jsonwebtoken": "^8.5.1", "jsonwebtoken": "^8.5.1",
"mongodb": "^4.3.0", "mongodb": "^4.3.0",
"mongoose": "^6.1.5", "mongoose": "^6.1.5",
"next": "^12.0.7", "next": "^12.0.7",
"next-iron-session": "^4.2.0",
"next-with-apollo": "^5.2.1", "next-with-apollo": "^5.2.1",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
@ -64,7 +64,14 @@
"//": "This is our babel config, I prefer this over a .babelrc file", "//": "This is our babel config, I prefer this over a .babelrc file",
"babel": { "babel": {
"plugins": [ "plugins": [
["styled-components", { "ssr": true, "displayName": true, "preprocess": false } ] [
"styled-components",
{
"ssr": true,
"displayName": true,
"preprocess": false
}
]
], ],
"env": { "env": {
"development": { "development": {
@ -119,4 +126,4 @@
} }
} }
} }
} }

View file

@ -21,7 +21,7 @@ export default withSession(async (req, res) => {
// TODO: REMOVE THIS IF GOING TO PRODUCTION // TODO: REMOVE THIS IF GOING TO PRODUCTION
if (process.env.SITE_ENV === 'TEST_SITE') { if (process.env.SITE_ENV === 'TEST_SITE') {
const user = { isLoggedIn: true, id: 'TEST_SITE_ID_123456' }; const user = { isLoggedIn: true, id: 'TEST_SITE_ID_123456' };
req.session.set('user', user); req.session.user = user;
await req.session.save(); await req.session.save();
res.json(user); res.json(user);
} else { } else {
@ -30,7 +30,7 @@ export default withSession(async (req, res) => {
isAuthorized = await compare(password, savedPassword); isAuthorized = await compare(password, savedPassword);
if (isAuthorized) { if (isAuthorized) {
const user = { isLoggedIn: isAuthorized, id: userData._id }; const user = { isLoggedIn: isAuthorized, id: userData._id };
req.session.set('user', user); req.session.user = user;
await req.session.save(); await req.session.save();
res.json(user); res.json(user);
} else { } else {

View file

@ -17,7 +17,7 @@ export default withSession(async (req, res) => {
role: 'guest', role: 'guest',
}); });
const user = { isLoggedIn: true, id: result?._id }; const user = { isLoggedIn: true, id: result?._id };
req.session.set('user', user); req.session.user = user;
await req.session.save(); await req.session.save();
res.status(201).json({ success: true }); res.status(201).json({ success: true });
} catch (error) { } catch (error) {

View file

@ -10,7 +10,7 @@ export default withSession(async (req, res) => {
session, session,
} = req; } = req;
const user = session.get('user'); const { user } = session;
if (!user?.isLoggedIn) { if (!user?.isLoggedIn) {
res.status(401).end(); res.status(401).end();

View file

@ -1,7 +1,7 @@
import withSession from '../../lib/session'; import withSession from '../../lib/session';
export default withSession(async (req, res) => { export default withSession(async (req, res) => {
const user = req.session.get('user'); const { user } = req.session;
if (user) { if (user) {
// in a real world application you might read the user id from the session and then do a database request // in a real world application you might read the user id from the session and then do a database request

View file

@ -40,42 +40,42 @@ const weddingParty = [
{ {
name: 'Best Man', name: 'Best Man',
title: 'Best Man', title: 'Best Man',
imageUrl: '', imageUrl: 'https://picsum.photos/1200/1600',
}, },
{ {
name: 'Man/Maid of Honor', name: 'Man/Maid of Honor',
title: 'Man/Maid of Honor', title: 'Man/Maid of Honor',
imageUrl: '', imageUrl: 'https://picsum.photos/1200/1601',
}, },
{ {
name: 'Groomsman', name: 'Groomsman',
title: 'Groomsman', title: 'Groomsman',
imageUrl: '', imageUrl: 'https://picsum.photos/1200/1602',
}, },
{ {
name: 'Bridesmaid', name: 'Bridesmaid',
title: 'Bridesmaid', title: 'Bridesmaid',
imageUrl: '', imageUrl: 'https://picsum.photos/1200/1603',
}, },
{ {
name: 'Groomsman', name: 'Groomsman',
title: 'Groomsman', title: 'Groomsman',
imageUrl: '', imageUrl: 'https://picsum.photos/1200/1604',
}, },
{ {
name: 'Bridesmaid', name: 'Bridesmaid',
title: 'Bridesmaid', title: 'Bridesmaid',
imageUrl: '', imageUrl: 'https://picsum.photos/1200/1605',
}, },
{ {
name: 'Groomsman', name: 'Groomsman',
title: 'Groomsman', title: 'Groomsman',
imageUrl: '', imageUrl: 'https://picsum.photos/1200/1606',
}, },
{ {
name: 'Bridesmaid', name: 'Bridesmaid',
title: 'Bridesmaid', title: 'Bridesmaid',
imageUrl: '', imageUrl: 'https://picsum.photos/200/308',
}, },
]; ];
@ -98,7 +98,7 @@ export default function PartyPage() {
> >
<h1 className="center">Meet our Wedding Party</h1> <h1 className="center">Meet our Wedding Party</h1>
<CustomNextImage <CustomNextImage
src="https://via.placeholder.com/450X800.png" src="https://picsum.photos/800/450"
alt="Wedding Party" alt="Wedding Party"
height={450} height={450}
width={800} width={800}
@ -116,7 +116,7 @@ export default function PartyPage() {
<PartyCard className="card"> <PartyCard className="card">
<h2 className="center">Officiant</h2> <h2 className="center">Officiant</h2>
<CustomNextImage <CustomNextImage
src="https://via.placeholder.com/1200x1600.png" src="https://picsum.photos/1200/1600"
alt="Wedding Officiant" alt="Wedding Officiant"
objectFit="cover" objectFit="cover"
width="1200" width="1200"
@ -130,7 +130,7 @@ export default function PartyPage() {
<PartyCard className="card" key={index}> <PartyCard className="card" key={index}>
<h2 className="center">{party.name}</h2> <h2 className="center">{party.name}</h2>
<CustomNextImage <CustomNextImage
src="https://via.placeholder.com/1200x1600.png" src={party.imageUrl}
alt={`${party.name} - ${party.title}`} alt={`${party.name} - ${party.title}`}
objectFit="cover" objectFit="cover"
width="1200" width="1200"

View file

@ -47,27 +47,27 @@ export default function PhotosPage() {
const photos = [ const photos = [
{ {
url: 'https://via.placeholder.com/1000x1000.png', url: 'https://picsum.photos/1000/1000',
alt: 'Photo 1', alt: 'Photo 1',
}, },
{ {
url: 'https://via.placeholder.com/1000x1000.png', url: 'https://picsum.photos/1000/1002',
alt: 'Photo 2', alt: 'Photo 2',
}, },
{ {
url: 'https://via.placeholder.com/1000x1000.png', url: 'https://picsum.photos/1000/1003',
alt: 'Photo 3', alt: 'Photo 3',
}, },
{ {
url: 'https://via.placeholder.com/1000x1000.png', url: 'https://picsum.photos/1000/1004',
alt: 'Photo 4', alt: 'Photo 4',
}, },
{ {
url: 'https://via.placeholder.com/1000x1000.png', url: 'https://picsum.photos/1000/1005',
alt: 'Photo 5', alt: 'Photo 5',
}, },
{ {
url: 'https://via.placeholder.com/1000x1000.png', url: 'https://picsum.photos/1000/1006',
alt: 'Photo 6', alt: 'Photo 6',
}, },
]; ];

View file

@ -19,7 +19,7 @@ export default function StoryPage() {
<PhotoPageStyles className="center"> <PhotoPageStyles className="center">
<h1>Our Story</h1> <h1>Our Story</h1>
<CustomNextImage <CustomNextImage
src="https://via.placeholder.com/450X800.png" src="https://picsum.photos/800/450"
alt="Placeholder Our Story Image" alt="Placeholder Our Story Image"
height={450} height={450}
width={800} width={800}