diff --git a/components/onboarding/Welcome.jsx b/components/onboarding/Welcome.jsx index 8510de08..c2a9dea9 100644 --- a/components/onboarding/Welcome.jsx +++ b/components/onboarding/Welcome.jsx @@ -2,18 +2,19 @@ import { useState, useCallback } from 'react' import { useResource, useAuthentication, useLoggedIn, useMyProfile, useProfile, useWebId, useEnsured } from 'swrlit' import { Logo } from '../logo' import { Loader } from '../elements' +import { handleToIdp } from '../../utils/uris' export default function Welcome() { const [username, setUsername] = useState("") const [badHandle, setBadHandle] = useState(false) const [loggingIn, setLoggingIn] = useState(false) - const { loginHandle, logout } = useAuthentication() + const { login } = useAuthentication() const handle = username.includes(".") ? username : `${username}.mysilio.me` async function logIn() { setBadHandle(false) setLoggingIn(true) try { - await loginHandle(handle); + await login({oidcIssuer: handleToIdp(handle), redirectUrl: window.location.href, clientName: "Mysilio Garden"}); } catch (e) { console.log("error:", e) setBadHandle(true) diff --git a/package-lock.json b/package-lock.json index ed5d3341..5d3eb00b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "nextjs-swrlit-tailwindcss", + "name": "mysilio-garden", "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "nextjs-swrlit-tailwindcss", + "name": "mysilio-garden", "version": "1.0.0", "license": "MIT", "dependencies": { @@ -52,7 +52,7 @@ "slate-hyperscript": "^0.62.0", "slate-react": "^0.63.0", "solid-auth-fetcher": "^1.5.3", - "swrlit": "0.15.0", + "swrlit": "1.0.0-beta.2", "typescript": "^4.3.5", "use-debounce": "^5.2.0", "uuid": "^8.3.2", @@ -2519,6 +2519,22 @@ "react": ">=16" } }, + "node_modules/@inrupt/jose-legacy-modules": { + "version": "0.0.3-3.15.4", + "resolved": "https://registry.npmjs.org/@inrupt/jose-legacy-modules/-/jose-legacy-modules-0.0.3-3.15.4.tgz", + "integrity": "sha512-gcmIqLLFyhNZWw9OKK3kNgEbpKU0z6kn6NPWQlJf0Dy5QtuIgwcS7aRU2GJScz+Dx9KGQVvyAapYX3buHyrBXw==", + "dependencies": { + "jose": "3.15.4" + } + }, + "node_modules/@inrupt/jose-legacy-modules/node_modules/jose": { + "version": "3.15.4", + "resolved": "https://registry.npmjs.org/jose/-/jose-3.15.4.tgz", + "integrity": "sha512-SXeGi+g5ZcNgV6o7f+Mx3Q1gaYMSBzAi3cmcZPxoeCEZPgfSCnnyfmMXzXoLDh+XL4KMtGvhOsYBoqQhnuR2rQ==", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, "node_modules/@inrupt/lit-generated-vocab-solid-common": { "version": "0.3.9", "integrity": "sha512-PTDbmo3GOwA/QiF9t6AVE0Z5878p9ToGwl+AcJ9z2NHgYNrW9jdRdWcfPKWNngCEvfmrCv1GxBA9PkHqQZTYBA==", @@ -2565,10 +2581,23 @@ "@types/node": "*" } }, + "node_modules/@inrupt/oidc-client-ext": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/@inrupt/oidc-client-ext/-/oidc-client-ext-1.11.2.tgz", + "integrity": "sha512-htdqsFnLOSUhi+AkhyYCTA1vjUsZT8TeQOiXEtLDgneCRxwxCGfRwVSgXSC30OeophlgrZ7/QVixaz3BB5yXEA==", + "dependencies": { + "@inrupt/jose-legacy-modules": "0.0.3-3.15.4", + "@inrupt/solid-client-authn-core": "^1.11.2", + "@types/uuid": "^8.3.0", + "form-urlencoded": "~6.0.3", + "oidc-client": "^1.11.3", + "uuid": "^8.3.1" + } + }, "node_modules/@inrupt/solid-client": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@inrupt/solid-client/-/solid-client-1.13.0.tgz", - "integrity": "sha512-iim0SJKLCwOFLBMPyAXKalceNdUmKQ+CilBRLL2adlNBgaWazqo5w1UaVhXGSXLkLmRlfYv9HJjkV/vSKbBecw==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@inrupt/solid-client/-/solid-client-1.14.0.tgz", + "integrity": "sha512-/h/enEWHk8/VRPDzJEuAgyp52AM6P89oI5VajNvtWZTm+WpIXhhGtKxd6XD4GCQC1UU6m5PdeAZDJ3nvW4lyXQ==", "dependencies": { "@rdfjs/dataset": "^1.1.0", "@rdfjs/types": "^1.0.1", @@ -2580,6 +2609,42 @@ "n3": "^1.10.0" } }, + "node_modules/@inrupt/solid-client-authn-browser": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-browser/-/solid-client-authn-browser-1.11.2.tgz", + "integrity": "sha512-DifF7hSMuFEB9+lDAYjRq6E7DOIZjQwdk9gUkPj93tdIb4icHXQ9JTMwBAxXmdTruPC2g5Pzu0PQ0PCvbIpuDA==", + "dependencies": { + "@inrupt/jose-legacy-modules": "0.0.3-3.15.4", + "@inrupt/oidc-client-ext": "^1.11.2", + "@inrupt/solid-client-authn-core": "^1.11.2", + "@types/lodash.clonedeep": "^4.5.6", + "@types/node": "^15.0.1", + "@types/uuid": "^8.3.0", + "events": "^3.3.0", + "lodash.clonedeep": "^4.5.0", + "uuid": "^8.3.1" + } + }, + "node_modules/@inrupt/solid-client-authn-core": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-core/-/solid-client-authn-core-1.11.2.tgz", + "integrity": "sha512-hL+BC81lE4V0EXZE8PJ418y/vFvW+rfcmHgHqi0ZKSSxLNVE08Ok4W2d+g6wcW3wyePZ9FOL2K8BIh7/jCGj8Q==", + "dependencies": { + "@inrupt/jose-legacy-modules": "0.0.3-3.15.4", + "@inrupt/solid-common-vocab": "^1.0.0", + "@types/lodash.clonedeep": "^4.5.6", + "@types/uuid": "^8.3.0", + "cross-fetch": "^3.0.6", + "events": "^3.3.0", + "lodash.clonedeep": "^4.5.0", + "uuid": "^8.3.1" + } + }, + "node_modules/@inrupt/solid-client-authn-core/node_modules/@inrupt/solid-common-vocab": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@inrupt/solid-common-vocab/-/solid-common-vocab-1.0.0.tgz", + "integrity": "sha512-LcImhJqqPsNl/OlULzEEK2rYevty0eh1zaOLVz3lnydEU1DQkeaJ8fKBxKdp5/QjCtnIYcaDjh5U11PGh29Dgg==" + }, "node_modules/@inrupt/solid-common-vocab": { "version": "0.5.3", "integrity": "sha512-/BKKIInQaP/D6tCFOvViN2Duv2RLAbXCNpQUtQjkz3t6cbmxPBTwGuvwDLan7R+yLJhbiJmJP4yNYEw/5Zc+Rg==", @@ -2596,39 +2661,27 @@ } }, "node_modules/@inrupt/vocab-common-rdf": { - "version": "0.6.3", - "integrity": "sha512-NFh+/GXKtBBKkz4wNTwXg5Oaax1Ie1WRzw0y0MiG6KiKnuna5TRDIPx6iancbhnAusZMqvc2oRxDRrK4tgA/YQ==", - "dependencies": { - "@inrupt/solid-common-vocab": "^0.5.1", - "@rdfjs/data-model": "^1.1.2", - "@rdfjs/dataset": "^1.0.1", - "@rdfjs/namespace": "^1.1.0", - "@types/rdf-js": "^3.0.3" - } - }, - "node_modules/@inrupt/vocab-common-rdf/node_modules/@types/rdf-js": { - "version": "3.0.3", - "integrity": "sha512-1dvodNHh/YpLovHA/b046Nu+xERVt0KcYJFQH1A8S4ZcMj+stYtx4ypXw0X2/oatbREUo4JW+cjoBll3CVtwSQ==", - "dependencies": { - "@types/node": "*" - } + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@inrupt/vocab-common-rdf/-/vocab-common-rdf-1.0.3.tgz", + "integrity": "sha512-AXaAwXpETLuzBKCQ6JW0VNnsi5TrdMygmykdG6yaCbdfKNzeHMgZ1Ku89zmVYI+efS1yrmle9bNsvIgEl/TCag==" }, "node_modules/@inrupt/vocab-solid-common": { - "version": "0.6.3", - "integrity": "sha512-vb1Yl4FgQZRVK2KakZNFb71MziuhEkfft0HZUT68b9XAXAgZSFMEJ2DfDE1L8/4xNJuDvqHPkvS+3MR3fvPo+Q==", + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/@inrupt/vocab-solid-common/-/vocab-solid-common-0.7.5.tgz", + "integrity": "sha512-56BptvPd9GfXXlmVmVjVHVmPa0OTTn5gg6YE1ye8jAcEfhiJJ4mgT+7ZiGa8Tu1bhIfx9+uORJoh6BiqLIHVUQ==", "dependencies": { - "@inrupt/solid-common-vocab": "^0.5.1", - "@rdfjs/data-model": "^1.1.2", - "@rdfjs/dataset": "^1.0.1", - "@rdfjs/namespace": "^1.1.0", - "@types/rdf-js": "^3.0.3" + "@inrupt/solid-common-vocab": "^0.5.3", + "@types/rdf-js": "^4.0.0", + "rdf-data-factory": "^1.0.4" } }, "node_modules/@inrupt/vocab-solid-common/node_modules/@types/rdf-js": { - "version": "3.0.3", - "integrity": "sha512-1dvodNHh/YpLovHA/b046Nu+xERVt0KcYJFQH1A8S4ZcMj+stYtx4ypXw0X2/oatbREUo4JW+cjoBll3CVtwSQ==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/rdf-js/-/rdf-js-4.0.2.tgz", + "integrity": "sha512-soR/+RMogGiDU1lrpuQl5ZL55/L1eq/JlR2dWx052Uh/RYs9okh3XZHFlIJXHZqjqyjEn4WdbOMfBj7vvc2WVQ==", + "deprecated": "This is a stub types definition. rdf-js provides its own type definitions, so you do not need this installed.", "dependencies": { - "@types/node": "*" + "rdf-js": "*" } }, "node_modules/@istanbuljs/load-nyc-config": { @@ -3494,16 +3547,6 @@ "rdfjs-dataset-test": "bin/test.js" } }, - "node_modules/@rdfjs/namespace": { - "version": "1.1.0", - "integrity": "sha512-utO5rtaOKxk8B90qzaQ0N+J5WrCI28DtfAY/zExCmXE7cOfC5uRI/oMKbLaVEPj2P7uArekt/T4IPATtj7Tjug==", - "dependencies": { - "@rdfjs/data-model": "^1.1.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/@rdfjs/types": { "version": "1.0.1", "integrity": "sha512-YxVkH0XrCNG3MWeZxfg596GFe+oorTVusmNxRP6ZHTsGczZ8AGvG3UchRNkg3Fy4MyysI7vBAA5YZbESL+VmHQ==", @@ -7288,7 +7331,6 @@ "node_modules/acorn": { "version": "7.4.1", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, "bin": { "acorn": "bin/acorn" }, @@ -9783,7 +9825,6 @@ "node_modules/core-js": { "version": "3.18.0", "integrity": "sha512-WJeQqq6jOYgVgg4NrXKL0KLQhi0CT4ZOCvFL+3CQ5o7I6J8HkT5wd53EadMfqTDp1so/MT1J+w2ujhWcCJtN7w==", - "dev": true, "hasInstallScript": true, "funding": { "type": "opencollective", @@ -10244,6 +10285,11 @@ "node": "*" } }, + "node_modules/crypto-js": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz", + "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==" + }, "node_modules/crypto-random-string": { "version": "3.3.1", "integrity": "sha512-5j88ECEn6h17UePrLi6pn1JcLtAiANa3KExyr9y9Z5vo2mv56Gh3I4Aja/B9P9uyMwyxNHAHWv+nE72f30T5Dg==", @@ -10619,6 +10665,7 @@ }, "node_modules/dequal": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.2.tgz", "integrity": "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==", "engines": { "node": ">=6" @@ -15683,18 +15730,10 @@ "version": "4.17.21", "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" }, - "node_modules/lodash.assign": { - "version": "4.2.0", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" - }, "node_modules/lodash.camelcase": { "version": "4.3.0", "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" }, - "node_modules/lodash.clone": { - "version": "4.5.0", - "integrity": "sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y=" - }, "node_modules/lodash.clonedeep": { "version": "4.5.0", "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" @@ -15704,22 +15743,10 @@ "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", "dev": true }, - "node_modules/lodash.fill": { - "version": "3.4.0", - "integrity": "sha1-o8dK5kDQU63w3CB5+HIHiOi/74U=" - }, - "node_modules/lodash.flatten": { - "version": "4.4.0", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=" - }, "node_modules/lodash.includes": { "version": "4.3.0", "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" }, - "node_modules/lodash.intersection": { - "version": "4.4.0", - "integrity": "sha1-ChG6Yx0OlcI8fy9Mu5ppLtF45wU=" - }, "node_modules/lodash.isboolean": { "version": "3.0.3", "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" @@ -15740,26 +15767,10 @@ "version": "4.0.1", "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" - }, - "node_modules/lodash.omit": { - "version": "4.5.0", - "integrity": "sha1-brGa5aHuHdnfC5aeZs4Lf6MLXmA=" - }, "node_modules/lodash.once": { "version": "4.1.1", "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" }, - "node_modules/lodash.partialright": { - "version": "4.2.1", - "integrity": "sha1-ATDYDoM2MmTUAHTzKbij56ihzEs=" - }, - "node_modules/lodash.pick": { - "version": "4.4.0", - "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=" - }, "node_modules/lodash.sortby": { "version": "4.7.0", "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=" @@ -15776,7 +15787,8 @@ }, "node_modules/lodash.uniq": { "version": "4.5.0", - "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", + "dev": true }, "node_modules/log-symbols": { "version": "4.1.0", @@ -17429,6 +17441,26 @@ "integrity": "sha512-eJJDYkhJFFbBBAxeh8xW+weHlkI28n2ZdQV/J/DNfWfSKlGEf2xcfAbZTv3riEXHAhL9SVOTs2pRmXiSTf78xg==", "dev": true }, + "node_modules/oidc-client": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/oidc-client/-/oidc-client-1.11.5.tgz", + "integrity": "sha512-LcKrKC8Av0m/KD/4EFmo9Sg8fSQ+WFJWBrmtWd+tZkNn3WT/sQG3REmPANE9tzzhbjW6VkTNy4xhAXCfPApAOg==", + "dependencies": { + "acorn": "^7.4.1", + "base64-js": "^1.5.1", + "core-js": "^3.8.3", + "crypto-js": "^4.0.0", + "serialize-javascript": "^4.0.0" + } + }, + "node_modules/oidc-client/node_modules/serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "dependencies": { + "randombytes": "^2.1.0" + } + }, "node_modules/on-finished": { "version": "2.3.0", "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", @@ -18887,6 +18919,14 @@ "node": ">=12" } }, + "node_modules/rdf-data-factory": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/rdf-data-factory/-/rdf-data-factory-1.1.0.tgz", + "integrity": "sha512-g8feOVZ/KL1OK2Pco/jDBDFh4m29QDsOOD+rWloG9qFvIzRFchGy2CviLUX491E0ByewXxMpaq/A3zsWHQA16A==", + "dependencies": { + "@rdfjs/types": "*" + } + }, "node_modules/rdf-js": { "version": "4.0.2", "integrity": "sha512-ApvlFa/WsQh8LpPK/6hctQwG06Z9ztQQGWVtrcrf9L6+sejHNXLPOqL+w7q3hF+iL0C4sv3AX1PUtGkLNzyZ0Q==", @@ -19314,44 +19354,6 @@ "react-dom": "^0.14.0 || ^15.0.0 || ^16 || ^17" } }, - "node_modules/react-native-jose": { - "version": "0.1.0", - "license": "Apache-2.0", - "dependencies": { - "base64url": "^3.0.0", - "buffer": "^5.2.0", - "es6-promise": "^4.0.5", - "lodash.assign": "^4.0.8", - "lodash.clone": "^4.3.2", - "lodash.fill": "^3.2.2", - "lodash.flatten": "^4.2.0", - "lodash.intersection": "^4.1.2", - "lodash.merge": "^4.3.5", - "lodash.omit": "^4.2.1", - "lodash.partialright": "^4.1.3", - "lodash.pick": "^4.2.0", - "lodash.uniq": "^4.2.1", - "long": "^4.0.0", - "node-forge": "^0.7.1", - "react-zlib-js": "^1.0.4", - "uuid": "^3.0.1" - } - }, - "node_modules/react-native-jose/node_modules/node-forge": { - "version": "0.7.6", - "integrity": "sha512-sol30LUpz1jQFBjOKwbjxijiE3b6pjd74YwfD0fJOKPjF+fONKb2Yg8rYgS6+bK6VDl+/wfr4IYpC7jDzLUIfw==", - "engines": { - "node": "*" - } - }, - "node_modules/react-native-jose/node_modules/uuid": { - "version": "3.4.0", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "bin": { - "uuid": "bin/uuid" - } - }, "node_modules/react-popper": { "version": "2.2.5", "integrity": "sha512-kxGkS80eQGtLl18+uig1UIf9MKixFSyPxglsgLBxlYnyDf65BiY9B3nZSc6C9XUNDgStROB0fMQlTEz1KxGddw==", @@ -22006,8 +22008,9 @@ } }, "node_modules/swr": { - "version": "0.5.6", - "integrity": "sha512-Bmx3L4geMZjYT5S2Z6EE6/5Cx6v1Ka0LhqZKq8d6WL2eu9y6gHWz3dUzfIK/ymZVHVfwT/EweFXiYGgfifei3w==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/swr/-/swr-1.0.1.tgz", + "integrity": "sha512-EPQAxSjoD4IaM49rpRHK0q+/NzcwoT8c0/Ylu/u3/6mFj/CWnQVjNJ0MV2Iuw/U+EJSd2TX5czdAwKPYZIG0YA==", "dependencies": { "dequal": "2.0.2" }, @@ -22016,16 +22019,17 @@ } }, "node_modules/swrlit": { - "version": "0.15.0", - "integrity": "sha512-rKDoSszPspR8vMUq3WUcylNE1twlZicTjgrUOEIM1JBoDsD/+DdOAvreMIxucONeTXQVYYUeQEE9cdnTxiICyg==", + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/swrlit/-/swrlit-1.0.0-beta.2.tgz", + "integrity": "sha512-fIGZQwZCSUUucd3WpyKAxwEXur+1G70GlsC7jxTEAA7g9ifPl8wyIy6DYeGh/g2BOlmFSiz4RwX37bOD7NqXIQ==", + "license": "MIT", "dependencies": { - "@inrupt/solid-client": "^1.1.0", - "@inrupt/vocab-common-rdf": "^0.6.3", - "@inrupt/vocab-solid-common": "^0.6.3", - "@types/url-parse": "^1.4.3", + "@inrupt/solid-client": "^1.14.0", + "@inrupt/solid-client-authn-browser": "^1.11.2", + "@inrupt/vocab-common-rdf": "^1.0.3", + "@inrupt/vocab-solid-common": "^0.7.5", "dequal": "^2.0.2", - "solid-auth-fetcher": "^1.3.5", - "swr": "^0.5.1", + "swr": "^1.0.1", "url-parse": "^1.4.7" }, "engines": { @@ -26523,6 +26527,21 @@ "integrity": "sha512-19DkLz8gDgbi+WvkoTzi9vs0NK9TJf94vbYhMzB4LYJo03Kili0gmvXT9CiKZoxXZ7YAvy/b1U1oQKEnjWrqxw==", "requires": {} }, + "@inrupt/jose-legacy-modules": { + "version": "0.0.3-3.15.4", + "resolved": "https://registry.npmjs.org/@inrupt/jose-legacy-modules/-/jose-legacy-modules-0.0.3-3.15.4.tgz", + "integrity": "sha512-gcmIqLLFyhNZWw9OKK3kNgEbpKU0z6kn6NPWQlJf0Dy5QtuIgwcS7aRU2GJScz+Dx9KGQVvyAapYX3buHyrBXw==", + "requires": { + "jose": "3.15.4" + }, + "dependencies": { + "jose": { + "version": "3.15.4", + "resolved": "https://registry.npmjs.org/jose/-/jose-3.15.4.tgz", + "integrity": "sha512-SXeGi+g5ZcNgV6o7f+Mx3Q1gaYMSBzAi3cmcZPxoeCEZPgfSCnnyfmMXzXoLDh+XL4KMtGvhOsYBoqQhnuR2rQ==" + } + } + }, "@inrupt/lit-generated-vocab-solid-common": { "version": "0.3.9", "integrity": "sha512-PTDbmo3GOwA/QiF9t6AVE0Z5878p9ToGwl+AcJ9z2NHgYNrW9jdRdWcfPKWNngCEvfmrCv1GxBA9PkHqQZTYBA==", @@ -26566,10 +26585,23 @@ } } }, + "@inrupt/oidc-client-ext": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/@inrupt/oidc-client-ext/-/oidc-client-ext-1.11.2.tgz", + "integrity": "sha512-htdqsFnLOSUhi+AkhyYCTA1vjUsZT8TeQOiXEtLDgneCRxwxCGfRwVSgXSC30OeophlgrZ7/QVixaz3BB5yXEA==", + "requires": { + "@inrupt/jose-legacy-modules": "0.0.3-3.15.4", + "@inrupt/solid-client-authn-core": "^1.11.2", + "@types/uuid": "^8.3.0", + "form-urlencoded": "~6.0.3", + "oidc-client": "^1.11.3", + "uuid": "^8.3.1" + } + }, "@inrupt/solid-client": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@inrupt/solid-client/-/solid-client-1.13.0.tgz", - "integrity": "sha512-iim0SJKLCwOFLBMPyAXKalceNdUmKQ+CilBRLL2adlNBgaWazqo5w1UaVhXGSXLkLmRlfYv9HJjkV/vSKbBecw==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@inrupt/solid-client/-/solid-client-1.14.0.tgz", + "integrity": "sha512-/h/enEWHk8/VRPDzJEuAgyp52AM6P89oI5VajNvtWZTm+WpIXhhGtKxd6XD4GCQC1UU6m5PdeAZDJ3nvW4lyXQ==", "requires": { "@rdfjs/dataset": "^1.1.0", "@rdfjs/types": "^1.0.1", @@ -26581,6 +26613,44 @@ "n3": "^1.10.0" } }, + "@inrupt/solid-client-authn-browser": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-browser/-/solid-client-authn-browser-1.11.2.tgz", + "integrity": "sha512-DifF7hSMuFEB9+lDAYjRq6E7DOIZjQwdk9gUkPj93tdIb4icHXQ9JTMwBAxXmdTruPC2g5Pzu0PQ0PCvbIpuDA==", + "requires": { + "@inrupt/jose-legacy-modules": "0.0.3-3.15.4", + "@inrupt/oidc-client-ext": "^1.11.2", + "@inrupt/solid-client-authn-core": "^1.11.2", + "@types/lodash.clonedeep": "^4.5.6", + "@types/node": "^15.0.1", + "@types/uuid": "^8.3.0", + "events": "^3.3.0", + "lodash.clonedeep": "^4.5.0", + "uuid": "^8.3.1" + } + }, + "@inrupt/solid-client-authn-core": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-core/-/solid-client-authn-core-1.11.2.tgz", + "integrity": "sha512-hL+BC81lE4V0EXZE8PJ418y/vFvW+rfcmHgHqi0ZKSSxLNVE08Ok4W2d+g6wcW3wyePZ9FOL2K8BIh7/jCGj8Q==", + "requires": { + "@inrupt/jose-legacy-modules": "0.0.3-3.15.4", + "@inrupt/solid-common-vocab": "^1.0.0", + "@types/lodash.clonedeep": "^4.5.6", + "@types/uuid": "^8.3.0", + "cross-fetch": "^3.0.6", + "events": "^3.3.0", + "lodash.clonedeep": "^4.5.0", + "uuid": "^8.3.1" + }, + "dependencies": { + "@inrupt/solid-common-vocab": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@inrupt/solid-common-vocab/-/solid-common-vocab-1.0.0.tgz", + "integrity": "sha512-LcImhJqqPsNl/OlULzEEK2rYevty0eh1zaOLVz3lnydEU1DQkeaJ8fKBxKdp5/QjCtnIYcaDjh5U11PGh29Dgg==" + } + } + }, "@inrupt/solid-common-vocab": { "version": "0.5.3", "integrity": "sha512-/BKKIInQaP/D6tCFOvViN2Duv2RLAbXCNpQUtQjkz3t6cbmxPBTwGuvwDLan7R+yLJhbiJmJP4yNYEw/5Zc+Rg==", @@ -26598,41 +26668,26 @@ } }, "@inrupt/vocab-common-rdf": { - "version": "0.6.3", - "integrity": "sha512-NFh+/GXKtBBKkz4wNTwXg5Oaax1Ie1WRzw0y0MiG6KiKnuna5TRDIPx6iancbhnAusZMqvc2oRxDRrK4tgA/YQ==", - "requires": { - "@inrupt/solid-common-vocab": "^0.5.1", - "@rdfjs/data-model": "^1.1.2", - "@rdfjs/dataset": "^1.0.1", - "@rdfjs/namespace": "^1.1.0", - "@types/rdf-js": "^3.0.3" - }, - "dependencies": { - "@types/rdf-js": { - "version": "3.0.3", - "integrity": "sha512-1dvodNHh/YpLovHA/b046Nu+xERVt0KcYJFQH1A8S4ZcMj+stYtx4ypXw0X2/oatbREUo4JW+cjoBll3CVtwSQ==", - "requires": { - "@types/node": "*" - } - } - } + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@inrupt/vocab-common-rdf/-/vocab-common-rdf-1.0.3.tgz", + "integrity": "sha512-AXaAwXpETLuzBKCQ6JW0VNnsi5TrdMygmykdG6yaCbdfKNzeHMgZ1Ku89zmVYI+efS1yrmle9bNsvIgEl/TCag==" }, "@inrupt/vocab-solid-common": { - "version": "0.6.3", - "integrity": "sha512-vb1Yl4FgQZRVK2KakZNFb71MziuhEkfft0HZUT68b9XAXAgZSFMEJ2DfDE1L8/4xNJuDvqHPkvS+3MR3fvPo+Q==", + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/@inrupt/vocab-solid-common/-/vocab-solid-common-0.7.5.tgz", + "integrity": "sha512-56BptvPd9GfXXlmVmVjVHVmPa0OTTn5gg6YE1ye8jAcEfhiJJ4mgT+7ZiGa8Tu1bhIfx9+uORJoh6BiqLIHVUQ==", "requires": { - "@inrupt/solid-common-vocab": "^0.5.1", - "@rdfjs/data-model": "^1.1.2", - "@rdfjs/dataset": "^1.0.1", - "@rdfjs/namespace": "^1.1.0", - "@types/rdf-js": "^3.0.3" + "@inrupt/solid-common-vocab": "^0.5.3", + "@types/rdf-js": "^4.0.0", + "rdf-data-factory": "^1.0.4" }, "dependencies": { "@types/rdf-js": { - "version": "3.0.3", - "integrity": "sha512-1dvodNHh/YpLovHA/b046Nu+xERVt0KcYJFQH1A8S4ZcMj+stYtx4ypXw0X2/oatbREUo4JW+cjoBll3CVtwSQ==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/rdf-js/-/rdf-js-4.0.2.tgz", + "integrity": "sha512-soR/+RMogGiDU1lrpuQl5ZL55/L1eq/JlR2dWx052Uh/RYs9okh3XZHFlIJXHZqjqyjEn4WdbOMfBj7vvc2WVQ==", "requires": { - "@types/node": "*" + "rdf-js": "*" } } } @@ -27265,13 +27320,6 @@ "@rdfjs/data-model": "^1.2.0" } }, - "@rdfjs/namespace": { - "version": "1.1.0", - "integrity": "sha512-utO5rtaOKxk8B90qzaQ0N+J5WrCI28DtfAY/zExCmXE7cOfC5uRI/oMKbLaVEPj2P7uArekt/T4IPATtj7Tjug==", - "requires": { - "@rdfjs/data-model": "^1.1.0" - } - }, "@rdfjs/types": { "version": "1.0.1", "integrity": "sha512-YxVkH0XrCNG3MWeZxfg596GFe+oorTVusmNxRP6ZHTsGczZ8AGvG3UchRNkg3Fy4MyysI7vBAA5YZbESL+VmHQ==", @@ -29972,8 +30020,7 @@ }, "acorn": { "version": "7.4.1", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==" }, "acorn-jsx": { "version": "5.3.2", @@ -31899,8 +31946,7 @@ }, "core-js": { "version": "3.18.0", - "integrity": "sha512-WJeQqq6jOYgVgg4NrXKL0KLQhi0CT4ZOCvFL+3CQ5o7I6J8HkT5wd53EadMfqTDp1so/MT1J+w2ujhWcCJtN7w==", - "dev": true + "integrity": "sha512-WJeQqq6jOYgVgg4NrXKL0KLQhi0CT4ZOCvFL+3CQ5o7I6J8HkT5wd53EadMfqTDp1so/MT1J+w2ujhWcCJtN7w==" }, "core-js-compat": { "version": "3.18.0", @@ -32268,6 +32314,11 @@ "randomfill": "^1.0.3" } }, + "crypto-js": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz", + "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==" + }, "crypto-random-string": { "version": "3.3.1", "integrity": "sha512-5j88ECEn6h17UePrLi6pn1JcLtAiANa3KExyr9y9Z5vo2mv56Gh3I4Aja/B9P9uyMwyxNHAHWv+nE72f30T5Dg==", @@ -32550,6 +32601,7 @@ }, "dequal": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.2.tgz", "integrity": "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==" }, "des.js": { @@ -36361,18 +36413,10 @@ "version": "4.17.21", "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" }, - "lodash.assign": { - "version": "4.2.0", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" - }, "lodash.camelcase": { "version": "4.3.0", "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" }, - "lodash.clone": { - "version": "4.5.0", - "integrity": "sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y=" - }, "lodash.clonedeep": { "version": "4.5.0", "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" @@ -36382,22 +36426,10 @@ "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", "dev": true }, - "lodash.fill": { - "version": "3.4.0", - "integrity": "sha1-o8dK5kDQU63w3CB5+HIHiOi/74U=" - }, - "lodash.flatten": { - "version": "4.4.0", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=" - }, "lodash.includes": { "version": "4.3.0", "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" }, - "lodash.intersection": { - "version": "4.4.0", - "integrity": "sha1-ChG6Yx0OlcI8fy9Mu5ppLtF45wU=" - }, "lodash.isboolean": { "version": "3.0.3", "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" @@ -36418,26 +36450,10 @@ "version": "4.0.1", "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" }, - "lodash.merge": { - "version": "4.6.2", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" - }, - "lodash.omit": { - "version": "4.5.0", - "integrity": "sha1-brGa5aHuHdnfC5aeZs4Lf6MLXmA=" - }, "lodash.once": { "version": "4.1.1", "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" }, - "lodash.partialright": { - "version": "4.2.1", - "integrity": "sha1-ATDYDoM2MmTUAHTzKbij56ihzEs=" - }, - "lodash.pick": { - "version": "4.4.0", - "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=" - }, "lodash.sortby": { "version": "4.7.0", "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=" @@ -36454,7 +36470,8 @@ }, "lodash.uniq": { "version": "4.5.0", - "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", + "dev": true }, "log-symbols": { "version": "4.1.0", @@ -37734,6 +37751,28 @@ "integrity": "sha512-eJJDYkhJFFbBBAxeh8xW+weHlkI28n2ZdQV/J/DNfWfSKlGEf2xcfAbZTv3riEXHAhL9SVOTs2pRmXiSTf78xg==", "dev": true }, + "oidc-client": { + "version": "1.11.5", + "resolved": "https://registry.npmjs.org/oidc-client/-/oidc-client-1.11.5.tgz", + "integrity": "sha512-LcKrKC8Av0m/KD/4EFmo9Sg8fSQ+WFJWBrmtWd+tZkNn3WT/sQG3REmPANE9tzzhbjW6VkTNy4xhAXCfPApAOg==", + "requires": { + "acorn": "^7.4.1", + "base64-js": "^1.5.1", + "core-js": "^3.8.3", + "crypto-js": "^4.0.0", + "serialize-javascript": "^4.0.0" + }, + "dependencies": { + "serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "requires": { + "randombytes": "^2.1.0" + } + } + } + }, "on-finished": { "version": "2.3.0", "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", @@ -38799,6 +38838,14 @@ "setimmediate": "^1.0.5" } }, + "rdf-data-factory": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/rdf-data-factory/-/rdf-data-factory-1.1.0.tgz", + "integrity": "sha512-g8feOVZ/KL1OK2Pco/jDBDFh4m29QDsOOD+rWloG9qFvIzRFchGy2CviLUX491E0ByewXxMpaq/A3zsWHQA16A==", + "requires": { + "@rdfjs/types": "*" + } + }, "rdf-js": { "version": "4.0.2", "integrity": "sha512-ApvlFa/WsQh8LpPK/6hctQwG06Z9ztQQGWVtrcrf9L6+sejHNXLPOqL+w7q3hF+iL0C4sv3AX1PUtGkLNzyZ0Q==", @@ -39126,38 +39173,6 @@ "warning": "^4.0.3" } }, - "react-native-jose": { - "version": "0.1.0", - "requires": { - "base64url": "^3.0.0", - "buffer": "^5.2.0", - "es6-promise": "^4.0.5", - "lodash.assign": "^4.0.8", - "lodash.clone": "^4.3.2", - "lodash.fill": "^3.2.2", - "lodash.flatten": "^4.2.0", - "lodash.intersection": "^4.1.2", - "lodash.merge": "^4.3.5", - "lodash.omit": "^4.2.1", - "lodash.partialright": "^4.1.3", - "lodash.pick": "^4.2.0", - "lodash.uniq": "^4.2.1", - "long": "^4.0.0", - "node-forge": "^0.7.1", - "react-zlib-js": "^1.0.4", - "uuid": "^3.0.1" - }, - "dependencies": { - "node-forge": { - "version": "0.7.6", - "integrity": "sha512-sol30LUpz1jQFBjOKwbjxijiE3b6pjd74YwfD0fJOKPjF+fONKb2Yg8rYgS6+bK6VDl+/wfr4IYpC7jDzLUIfw==" - }, - "uuid": { - "version": "3.4.0", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" - } - } - }, "react-popper": { "version": "2.2.5", "integrity": "sha512-kxGkS80eQGtLl18+uig1UIf9MKixFSyPxglsgLBxlYnyDf65BiY9B3nZSc6C9XUNDgStROB0fMQlTEz1KxGddw==", @@ -41241,23 +41256,24 @@ } }, "swr": { - "version": "0.5.6", - "integrity": "sha512-Bmx3L4geMZjYT5S2Z6EE6/5Cx6v1Ka0LhqZKq8d6WL2eu9y6gHWz3dUzfIK/ymZVHVfwT/EweFXiYGgfifei3w==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/swr/-/swr-1.0.1.tgz", + "integrity": "sha512-EPQAxSjoD4IaM49rpRHK0q+/NzcwoT8c0/Ylu/u3/6mFj/CWnQVjNJ0MV2Iuw/U+EJSd2TX5czdAwKPYZIG0YA==", "requires": { "dequal": "2.0.2" } }, "swrlit": { - "version": "0.15.0", - "integrity": "sha512-rKDoSszPspR8vMUq3WUcylNE1twlZicTjgrUOEIM1JBoDsD/+DdOAvreMIxucONeTXQVYYUeQEE9cdnTxiICyg==", + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/swrlit/-/swrlit-1.0.0-beta.2.tgz", + "integrity": "sha512-fIGZQwZCSUUucd3WpyKAxwEXur+1G70GlsC7jxTEAA7g9ifPl8wyIy6DYeGh/g2BOlmFSiz4RwX37bOD7NqXIQ==", "requires": { - "@inrupt/solid-client": "^1.1.0", - "@inrupt/vocab-common-rdf": "^0.6.3", - "@inrupt/vocab-solid-common": "^0.6.3", - "@types/url-parse": "^1.4.3", + "@inrupt/solid-client": "^1.14.0", + "@inrupt/solid-client-authn-browser": "^1.11.2", + "@inrupt/vocab-common-rdf": "^1.0.3", + "@inrupt/vocab-solid-common": "^0.7.5", "dequal": "^2.0.2", - "solid-auth-fetcher": "^1.3.5", - "swr": "^0.5.1", + "swr": "^1.0.1", "url-parse": "^1.4.7" } }, diff --git a/package.json b/package.json index 45ac19fd..e5b3c76d 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "nextjs-swrlit-tailwindcss", + "name": "mysilio-garden", "version": "1.0.0", "scripts": { "dev": "next", @@ -53,7 +53,7 @@ "slate-hyperscript": "^0.62.0", "slate-react": "^0.63.0", "solid-auth-fetcher": "^1.5.3", - "swrlit": "0.15.0", + "swrlit": "1.0.0-beta.2", "typescript": "^4.3.5", "use-debounce": "^5.2.0", "uuid": "^8.3.2", diff --git a/pages/_app.jsx b/pages/_app.jsx index ed8f7dc2..71398433 100644 --- a/pages/_app.jsx +++ b/pages/_app.jsx @@ -2,7 +2,7 @@ import { useEffect } from 'react' import 'tippy.js/dist/tippy.css'; import "cropperjs/dist/cropper.css"; import '../styles/index.css' -import { AuthenticationProvider } from 'swrlit' +import { AuthenticationProvider, useAuthentication } from 'swrlit' import Head from 'next/head' import { useRouter } from 'next/router' import { DndProvider } from 'react-dnd' @@ -11,6 +11,17 @@ import { SWRConfig } from 'swr' import { useFathom } from '../hooks/fathom' import LoginVerifier from '../components/LoginVerifier' +function RenderAfterAuthed({ children }) { + const { info } = useAuthentication() + + return info ? ( + <> + {children} + > + ) : (<>>) +} + + function MyApp({ Component, pageProps }) { const router = useRouter() // disable to debug issues in staging @@ -19,7 +30,7 @@ function MyApp({ Component, pageProps }) { return ( <>
- @@ -33,16 +44,25 @@ function MyApp({ Component, pageProps }) {