diff --git a/package-lock.json b/package-lock.json index e905f421..392fba2f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -435,6 +435,63 @@ "@babel/types": "^7.8.3" } }, + "@babel/helper-module-transforms": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz", + "integrity": "sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==", + "requires": { + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-simple-access": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/template": "^7.10.4", + "@babel/types": "^7.11.0", + "lodash": "^4.17.19" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-module-imports": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", + "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/parser": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", + "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==" + }, + "@babel/template": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", + "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/types": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + } + } + }, "@babel/helper-optimise-call-expression": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", @@ -2031,9 +2088,9 @@ } }, "@dotkomonline/design-system": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@dotkomonline/design-system/-/design-system-0.16.0.tgz", - "integrity": "sha512-Oy9N4Y+jvSMrjQLX+laU8Q11OddXN7B9EZXi+Wcbu1aKDBJnYUS9F1a6jhovlUxz8W672J8k+pIQ9wbp3sALfA==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@dotkomonline/design-system/-/design-system-0.18.0.tgz", + "integrity": "sha512-8m4d9+vL65oshxnQYkHnPuvWWdZmWAvk1GpQCnXLFCB0YaMc7dAwohpTJawJvdtpubIFhTSt2qAVKO21kc8qsw==", "requires": { "@storybook/addon-a11y": "^5.3.12", "@storybook/addon-actions": "^5.3.12", @@ -2460,28 +2517,6 @@ "source-map": "^0.5.0" } }, - "@babel/helper-module-imports": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", - "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", - "requires": { - "@babel/types": "^7.10.4" - } - }, - "@babel/helper-module-transforms": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz", - "integrity": "sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==", - "requires": { - "@babel/helper-module-imports": "^7.10.4", - "@babel/helper-replace-supers": "^7.10.4", - "@babel/helper-simple-access": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/template": "^7.10.4", - "@babel/types": "^7.11.0", - "lodash": "^4.17.19" - } - }, "@babel/helpers": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", @@ -2782,6 +2817,11 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==" }, + "@panva/asn1.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@panva/asn1.js/-/asn1.js-1.0.0.tgz", + "integrity": "sha512-UdkG3mLEqXgnlKsWanWcgb6dOjUzJ+XC5f+aWw30qrtjxeNUSfKX1cd5FBzOaXQumoe9nIqeZUvrRJS03HCCtw==" + }, "@reach/router": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/@reach/router/-/router-1.3.4.tgz", @@ -3267,11 +3307,6 @@ "webpack-virtual-modules": "^0.2.0" }, "dependencies": { - "@types/json-schema": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", - "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==" - }, "ajv": { "version": "6.12.5", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", @@ -4052,9 +4087,9 @@ } }, "@types/html-minifier-terser": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-5.1.0.tgz", - "integrity": "sha512-iYCgjm1dGPRuo12+BStjd1HiVQqhlRhWDOQigNxn023HcjnhsiFz9pc6CzJj4HwDCSQca9bxTL4PxJDbkdm3PA==" + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz", + "integrity": "sha512-giAlZwstKbmvMk1OO7WXSj4OZ0keXAcl2TQq4LWHiiPH2ByaH7WeUzng+Qej8UPxxv+8lRTuouo0iaNDBuzIBA==" }, "@types/is-function": { "version": "1.0.0", @@ -4095,8 +4130,7 @@ "@types/json-schema": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", - "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", - "dev": true + "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==" }, "@types/json5": { "version": "0.0.29", @@ -4131,6 +4165,17 @@ "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", "dev": true }, + "@types/next-auth": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@types/next-auth/-/next-auth-3.1.8.tgz", + "integrity": "sha512-36uywTxxMBTtERwbbAB0iyZLnT0227NOcNPRdNsvoxee2HedAdXEBg2+tHAypDHpIqeDnAmaqT7XNfq3HjwlSw==", + "requires": { + "@types/node": "*", + "@types/react": "*", + "jose": "^1.28.0", + "typeorm": "^0.2.24" + } + }, "@types/node": { "version": "13.13.4", "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.4.tgz", @@ -4171,9 +4216,9 @@ } }, "@types/reach__router": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/reach__router/-/reach__router-1.3.5.tgz", - "integrity": "sha512-h0NbqXN/tJuBY/xggZSej1SKQEstbHO7J/omt1tYoFGmj3YXOodZKbbqD4mNDh7zvEGYd7YFrac1LTtAr3xsYQ==", + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/@types/reach__router/-/reach__router-1.3.6.tgz", + "integrity": "sha512-RHYataCUPQnt+GHoASyRLq6wmZ0n8jWlBW8Lxcwd30NN6vQfbmTeoSDfkgxO0S1lEzArp8OFDsq5KIs7FygjtA==", "requires": { "@types/history": "*", "@types/react": "*" @@ -5200,6 +5245,11 @@ "entities": "^1.1.2" } }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" + }, "anymatch": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", @@ -5214,6 +5264,11 @@ "resolved": "https://registry.npmjs.org/app-root-dir/-/app-root-dir-1.0.2.tgz", "integrity": "sha1-OBh+wt6nV3//Az/8sSFyaS/24Rg=" }, + "app-root-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.0.0.tgz", + "integrity": "sha512-qMcx+Gy2UZynHjOHOIXPNvpf+9cjvk3cWrBBK7zg4gH9+clobJRb9NGzcT7mQTcV/6Gm/1WelUtqxVXnNlrwcw==" + }, "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", @@ -5804,9 +5859,9 @@ "integrity": "sha512-1aGDUfL1qOOIoqk9QKGIo2lANk+C7ko/fqH0uIyC71x3PEGz0uVP8ISgfEsFuG+FKmjHTvFK/nNM8dowpmUxLA==" }, "babel-plugin-react-docgen": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/babel-plugin-react-docgen/-/babel-plugin-react-docgen-4.1.0.tgz", - "integrity": "sha512-vzpnBlfGv8XOhJM2zbPyyqw2OLEbelgZZsaaRRTpVwNKuYuc+pUg4+dy7i9gCRms0uOQn4osX571HRcCJMJCmA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/babel-plugin-react-docgen/-/babel-plugin-react-docgen-4.2.0.tgz", + "integrity": "sha512-B3tjZwKskcia9TsqkND+9OTjl/F5A5OBvRJ6Ktg34CONoxm+kB3CJ52wk5TjbszX9gqCPcAuc0GgkhT0CLuT/Q==", "requires": { "lodash": "^4.17.15", "react-docgen": "^5.0.0", @@ -6413,6 +6468,11 @@ "isarray": "^1.0.0" } }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -6849,6 +6909,180 @@ "restore-cursor": "^3.1.0" } }, + "cli-highlight": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.4.tgz", + "integrity": "sha512-s7Zofobm20qriqDoU9sXptQx0t2R9PEgac92mENNm7xaEe1hn71IIMsXMK+6encA6WRCWWxIGQbipr3q998tlQ==", + "requires": { + "chalk": "^3.0.0", + "highlight.js": "^9.6.0", + "mz": "^2.4.0", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^5.1.1", + "yargs": "^15.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==" + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "cli-table3": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.5.1.tgz", @@ -6903,7 +7137,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, "requires": { "string-width": "^3.1.0", "strip-ansi": "^5.2.0", @@ -7318,12 +7551,6 @@ "randomfill": "^1.0.3" } }, - "crypto-js": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz", - "integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==", - "dev": true - }, "css": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz", @@ -7706,8 +7933,7 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" }, "decamelize-keys": { "version": "1.1.0", @@ -8088,6 +8314,14 @@ "safer-buffer": "^2.1.0" } }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -9066,6 +9300,11 @@ "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==" }, + "figlet": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/figlet/-/figlet-1.5.0.tgz", + "integrity": "sha512-ZQJM4aifMpz6H19AW1VqvZ7l4pOE9p7i/3LyxgO2kp+PO/VcDYNqIHEMtkccqIhTXMKci4kjueJr/iCQEaT/Ww==" + }, "figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -9511,6 +9750,11 @@ "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-3.6.1.tgz", "integrity": "sha512-hT9yh/tiinkmirKrlv4KWOjztdoZo1mx9Qh4KvWqC7isoXwdUY3PNWUxceF4/qO9R6riA2C29jdTOeQOIROjgw==" }, + "futoin-hkdf": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/futoin-hkdf/-/futoin-hkdf-1.3.2.tgz", + "integrity": "sha512-3EVi3ETTyJg5PSXlxLCaUVVn0pSbDf62L3Gwxne7Uq+d8adOSNWQAad4gg7WToHkcgnCJb3Wlb1P8r4Evj4GPw==" + }, "gauge": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", @@ -9570,8 +9814,7 @@ "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "get-node-dimensions": { "version": "1.2.1", @@ -10183,9 +10426,9 @@ "integrity": "sha512-uE/TxKuyNIcx44cIWnjr/rfIATDH7ZaOMmstu0CwhFG1Dunhlp4OC6/NMbhiwoq5BpW0ubi303qnEk/PZj614w==" }, "html-webpack-plugin": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-4.4.1.tgz", - "integrity": "sha512-nEtdEIsIGXdXGG7MjTTZlmhqhpHU9pJFc1OYxcP36c5/ZKP6b0BJMww2QTvJGQYA9aMxUnjDujpZdYcVOXiBCQ==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-4.5.0.tgz", + "integrity": "sha512-MouoXEYSjTzCrjIxWwg8gxL5fE2X2WZJLmBYXlaJhQUH5K/b5OrqmV7T4dB7iu0xkmJ6JlUuV6fFVtnqbPopZw==", "requires": { "@types/html-minifier-terser": "^5.0.0", "@types/tapable": "^1.0.5", @@ -11497,6 +11740,14 @@ "supports-color": "^6.1.0" } }, + "jose": { + "version": "1.28.0", + "resolved": "https://registry.npmjs.org/jose/-/jose-1.28.0.tgz", + "integrity": "sha512-JmfDRzt/HSj8ipd9TsDtEHoLUnLYavG+7e8F6s1mx2jfVSfXOTaFQsJUydbjJpTnTDHP1+yKL9Ke7ktS/a0Eiw==", + "requires": { + "@panva/asn1.js": "^1.0.0" + } + }, "js-string-escape": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", @@ -11692,6 +11943,23 @@ "graceful-fs": "^4.1.6" } }, + "jsonwebtoken": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "requires": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + } + }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -11723,6 +11991,30 @@ "object.assign": "^4.1.0" } }, + "jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "requires": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "jwt-decode": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-2.2.0.tgz", + "integrity": "sha1-fYa9VmefWM5qhHBKZX3TkruoGnk=" + }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -11905,17 +12197,52 @@ "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, + "lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" + }, + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" + }, "lodash.isequal": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", "dev": true }, + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" + }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" + }, "lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=" }, + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" + }, "lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", @@ -12599,6 +12926,16 @@ "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" }, + "mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "requires": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, "nan": { "version": "2.14.1", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", @@ -13409,6 +13746,32 @@ } } }, + "next-auth": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-3.1.0.tgz", + "integrity": "sha512-e+s6hjPZpqbnjla9WOi0VuLkDlLMU3cJmS0jTBBvsvSGsOPvMbaCCAMBEoNV3nWSgPrq6zLG2dixmCCxzG7fXA==", + "requires": { + "crypto-js": "^4.0.0", + "futoin-hkdf": "^1.3.2", + "jose": "^1.27.2", + "jsonwebtoken": "^8.5.1", + "jwt-decode": "^2.2.0", + "nodemailer": "^6.4.6", + "oauth": "^0.9.15", + "preact": "^10.4.1", + "preact-render-to-string": "^5.1.7", + "querystring": "^0.2.0", + "require_optional": "^1.0.1", + "typeorm": "^0.2.24" + }, + "dependencies": { + "crypto-js": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.0.0.tgz", + "integrity": "sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg==" + } + } + }, "next-redux-wrapper": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/next-redux-wrapper/-/next-redux-wrapper-5.0.0.tgz", @@ -13526,6 +13889,11 @@ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.61.tgz", "integrity": "sha512-DD5vebQLg8jLCOzwupn954fbIiZht05DAZs0k2u8NStSe6h9XdsuIQL8hSRKYiU8WUQRznmSDrKGbv3ObOmC7g==" }, + "nodemailer": { + "version": "6.4.11", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.4.11.tgz", + "integrity": "sha512-BVZBDi+aJV4O38rxsUh164Dk1NCqgh6Cm0rQSb9SK/DHGll/DrCMnycVDD7msJgZCnmVa8ASo8EZzR7jsgTukQ==" + }, "normalize-html-whitespace": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/normalize-html-whitespace/-/normalize-html-whitespace-1.0.0.tgz", @@ -13631,6 +13999,11 @@ "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", "dev": true }, + "oauth": { + "version": "0.9.15", + "resolved": "https://registry.npmjs.org/oauth/-/oauth-0.9.15.tgz", + "integrity": "sha1-vR/vr2hslrdUda7VGWQS/2DPucE=" + }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", @@ -13763,26 +14136,6 @@ "has": "^1.0.3" } }, - "oidc-client": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/oidc-client/-/oidc-client-1.10.1.tgz", - "integrity": "sha512-/QB5Nl7c9GmT9ir1E+OVY3+yZZnuk7Qa9ZEAJqSvDq0bAyAU9KAgeKipTEfKjGdGLTeOLy9FRWuNpULMkfZydQ==", - "dev": true, - "requires": { - "base64-js": "^1.3.0", - "core-js": "^2.6.4", - "crypto-js": "^3.1.9-1", - "uuid": "^3.3.2" - }, - "dependencies": { - "core-js": { - "version": "2.6.11", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", - "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==", - "dev": true - } - } - }, "on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -13943,6 +14296,11 @@ "callsites": "^3.0.0" } }, + "parent-require": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parent-require/-/parent-require-1.0.0.tgz", + "integrity": "sha1-dGoWdjgIOoYLDu9nMssn7UbDKXc=" + }, "parse-asn1": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", @@ -13986,6 +14344,21 @@ "@types/node": "*" } }, + "parse5-htmlparser2-tree-adapter": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-5.1.1.tgz", + "integrity": "sha512-CF+TKjXqoqyDwHqBhFQ+3l5t83xYi6fVT1tQNg+Ye0JRLnTxWvIroCjEp1A0k4lneHNBGnICUf0cfYVYGEazqw==", + "requires": { + "parse5": "^5.1.1" + }, + "dependencies": { + "parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==" + } + } + }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -14512,6 +14885,26 @@ "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==" }, + "preact": { + "version": "10.5.2", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.5.2.tgz", + "integrity": "sha512-4y2Q6kMiJtMONMJR7z+o8P5tGkMzVItyy77AXGrUdusv+dk4jwoS3KrpCBkFloY2xsScRJYwZQZrx89tTjDkOw==" + }, + "preact-render-to-string": { + "version": "5.1.10", + "resolved": "https://registry.npmjs.org/preact-render-to-string/-/preact-render-to-string-5.1.10.tgz", + "integrity": "sha512-40svy7NDe5Qe0ymdsIC11f0hZb05MeTSUqqIaWJ5DEFCh/sF86KcpRW0kN/ymGYDVVUCfv9qFrVuLCXR7aQxgQ==", + "requires": { + "pretty-format": "^3.8.0" + }, + "dependencies": { + "pretty-format": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-3.8.0.tgz", + "integrity": "sha1-v77VbV6ad2ZF9LH/eqGjrE+jw4U=" + } + } + }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -14994,11 +15387,6 @@ "schema-utils": "^2.0.1" }, "dependencies": { - "@types/json-schema": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", - "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==" - }, "ajv": { "version": "6.12.5", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", @@ -15871,6 +16259,11 @@ "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.3.0.tgz", "integrity": "sha512-km6dclyFnmcvxhAcrQV2AkZmPQjzPDjgVlQtR0EQjxZPyJ0BnMf3in1ryuR8A2qU0HldVRfxYXbFSKlI3N7Slw==" }, + "reflect-metadata": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" + }, "reflect.ownkeys": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz", @@ -16143,28 +16536,6 @@ "source-map": "^0.5.0" } }, - "@babel/helper-module-imports": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", - "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", - "requires": { - "@babel/types": "^7.10.4" - } - }, - "@babel/helper-module-transforms": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz", - "integrity": "sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==", - "requires": { - "@babel/helper-module-imports": "^7.10.4", - "@babel/helper-replace-supers": "^7.10.4", - "@babel/helper-simple-access": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/template": "^7.10.4", - "@babel/types": "^7.11.0", - "lodash": "^4.17.19" - } - }, "@babel/helper-plugin-utils": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", @@ -16450,14 +16821,29 @@ "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, + "require_optional": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", + "integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==", + "requires": { + "resolve-from": "^2.0.0", + "semver": "^5.1.0" + }, + "dependencies": { + "resolve-from": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", + "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" + } + } + }, "requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -18160,11 +18546,6 @@ "webpack-sources": "^1.4.3" }, "dependencies": { - "@types/json-schema": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", - "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==" - }, "ajv": { "version": "6.12.5", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", @@ -18345,6 +18726,22 @@ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" }, + "thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "requires": { + "any-promise": "^1.0.0" + } + }, + "thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", + "requires": { + "thenify": ">= 3.1.0 < 4" + } + }, "throat": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz", @@ -18385,9 +18782,9 @@ "optional": true }, "tinycolor2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.1.tgz", - "integrity": "sha1-9PrTM0R7wLB9TcjpIJ2POaisd+g=" + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.2.tgz", + "integrity": "sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA==" }, "tmp": { "version": "0.0.33", @@ -18665,6 +19062,49 @@ "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, + "typeorm": { + "version": "0.2.26", + "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.2.26.tgz", + "integrity": "sha512-sbKxK6K9sXZPCVF0weEb74UA/z1UW0sRWfI7EoOOtQaRZaLvSEwtgHPqle9t8asxEtD+gzkUdd+NqF7yH7HtIQ==", + "requires": { + "app-root-path": "^3.0.0", + "buffer": "^5.1.0", + "chalk": "^2.4.2", + "cli-highlight": "^2.0.0", + "debug": "^4.1.1", + "dotenv": "^8.2.0", + "glob": "^7.1.2", + "js-yaml": "^3.13.1", + "mkdirp": "^1.0.3", + "reflect-metadata": "^0.1.13", + "sha.js": "^2.4.11", + "tslib": "^1.9.0", + "xml2js": "^0.4.17", + "yargonaut": "^1.1.2", + "yargs": "^13.2.1" + }, + "dependencies": { + "buffer": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", + "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "dotenv": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", + "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==" + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + } + } + }, "typescript": { "version": "3.8.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", @@ -19160,9 +19600,9 @@ "integrity": "sha1-YU9/v42AHwu18GYfWy9XhXUOTwk=" }, "vue-docgen-api": { - "version": "4.32.1", - "resolved": "https://registry.npmjs.org/vue-docgen-api/-/vue-docgen-api-4.32.1.tgz", - "integrity": "sha512-N9xI2OZ+0aZgJrHzTEkNCOu2EBGUWkofJIVMZCQ9Z/IrMsEoezWGQ17qkcqlLpxepgl4NCjPBNZqqb6TZCCMlA==", + "version": "4.32.4", + "resolved": "https://registry.npmjs.org/vue-docgen-api/-/vue-docgen-api-4.32.4.tgz", + "integrity": "sha512-dtPOg9uCnclBOiWASMDMBjYhrXbRDlADZNTMkc5NtF1eSXzltN7GvB7P3YO92M5IvUeHwq84A9BqGBBbye5oWg==", "requires": { "@babel/parser": "^7.6.0", "@babel/types": "^7.6.0", @@ -19515,8 +19955,7 @@ "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, "wide-align": { "version": "1.1.3", @@ -19629,7 +20068,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, "requires": { "ansi-styles": "^3.2.0", "string-width": "^3.0.0", @@ -19680,6 +20118,20 @@ "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", "dev": true }, + "xml2js": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", + "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + } + }, + "xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" + }, "xregexp": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.3.0.tgz", @@ -19709,11 +20161,52 @@ "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==" }, + "yargonaut": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/yargonaut/-/yargonaut-1.1.4.tgz", + "integrity": "sha512-rHgFmbgXAAzl+1nngqOcwEljqHGG9uUZoPjsdZEs1w5JW9RXYzrSvH/u70C1JE5qFi0qjsdhnUX/dJRpWqitSA==", + "requires": { + "chalk": "^1.1.1", + "figlet": "^1.1.1", + "parent-require": "^1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } + }, "yargs": { "version": "13.3.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, "requires": { "cliui": "^5.0.0", "find-up": "^3.0.0", @@ -19731,7 +20224,6 @@ "version": "13.1.2", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" diff --git a/package.json b/package.json index b0160728..cc28dac5 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,6 @@ "less": "^3.9.0", "luxon": "^1.11.1", "multirange": "^2.0.0", - "oidc-client": "^1.6.1", "postcss-loader": "^3.0.0", "prettier": "^1.16.4", "query-string": "^6.2.0", @@ -75,6 +74,7 @@ "@sentry/node": "^5.6.2", "@types/classnames": "^2.2.7", "@types/markdown-to-jsx": "^6.11.0", + "@types/next-auth": "^3.1.5", "@types/react-google-recaptcha": "^1.1.1", "@types/react-redux": "^7.1.0", "@types/react-select": "^3.0.5", @@ -91,6 +91,7 @@ "isomorphic-fetch": "^2.2.1", "markdown-to-jsx": "^6.11.1", "next": "^9.5.3", + "next-auth": "^3.1.0", "next-redux-wrapper": "^5.0.0", "postcss-focus-visible": "^4.0.0", "react-day-picker": "^7.3.0", diff --git a/src/authentication/api/index.ts b/src/authentication/api/index.ts index de274c7f..524715f7 100644 --- a/src/authentication/api/index.ts +++ b/src/authentication/api/index.ts @@ -1,32 +1,20 @@ -import { __CLIENT__ } from 'common/constants/environment'; -import { UserManager } from 'oidc-client'; -import settings from './settings'; import { IAuthUser } from 'authentication/models/User'; - +import { signIn, signOut, getSession } from 'next-auth/client'; /** * @summary Basic wrapper for OIDC login. * Redirects the user to the authentication page defined in settings. */ -export const USER_MANAGER = __CLIENT__ ? new UserManager(settings) : null; - export const logIn = async () => { - if (USER_MANAGER) { - const user = await USER_MANAGER.signinRedirect({ data: window.location.pathname }); - return user; - } - return null; + return await signIn('onlineweb4'); }; /** * @summary Returns user if logged in */ export const getUser = async (): Promise => { - if (USER_MANAGER) { - const user = (await USER_MANAGER.getUser()) as IAuthUser | null; - return user || undefined; - } - return undefined; + const session = await getSession(); + return (session?.user as unknown) as IAuthUser; }; /** @@ -34,7 +22,5 @@ export const getUser = async (): Promise => { */ export const logOut = async () => { - if (USER_MANAGER) { - await USER_MANAGER.signoutRedirect(); - } + return await signOut(); }; diff --git a/src/authentication/api/settings.ts b/src/authentication/api/settings.ts deleted file mode 100644 index c47eea2b..00000000 --- a/src/authentication/api/settings.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { DOMAIN } from 'common/constants/endpoints'; -import { UserManagerSettings } from 'oidc-client'; - -const settings: UserManagerSettings = { - authority: DOMAIN + '/openid', - client_id: process.env.OW4_SSO_CLIENT_ID || '', - redirect_uri: process.env.OW4_SSO_CALLBACK || '', - post_logout_redirect_uri: DOMAIN + '/', - response_type: 'id_token token', - scope: 'openid profile onlineweb4', - automaticSilentRenew: true, - filterProtocolClaims: true, - loadUserInfo: true, - silent_redirect_uri: process.env.OW4_SSO_CALLBACK || '', - revokeAccessTokenOnSignout: true, -}; - -export default settings; diff --git a/src/authentication/components/AuthenticationCallback.tsx b/src/authentication/components/AuthenticationCallback.tsx deleted file mode 100644 index 810d18d1..00000000 --- a/src/authentication/components/AuthenticationCallback.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { useRouter } from 'next/router'; -import React, { FC, useEffect } from 'react'; - -import { getFrontPageUrl } from 'core/appUrls'; -import { USER_MANAGER } from 'authentication/api'; - -const AuthenticationCallbackComponent: FC = ({ children }) => { - const router = useRouter(); - const catchCallback = async () => { - if (USER_MANAGER) { - const frontPageUrl = getFrontPageUrl().href; - try { - const user = await USER_MANAGER.signinCallback(); - router.push(user.state || frontPageUrl); - } catch (err) { - router.push(frontPageUrl); - } - } - }; - - useEffect(() => { - catchCallback(); - }, []); - - return <>{children}; -}; - -export const AuthenticationCallback = AuthenticationCallbackComponent; diff --git a/src/authentication/components/PrivateLink.tsx b/src/authentication/components/PrivateLink.tsx index c699dff4..2b4fa3dc 100644 --- a/src/authentication/components/PrivateLink.tsx +++ b/src/authentication/components/PrivateLink.tsx @@ -1,15 +1,14 @@ import Link from 'next/link'; import React, { ComponentProps } from 'react'; import { getLoginPageUrl } from 'core/appUrls'; -import { useSelector } from 'react-redux'; -import { selectIsLoggedIn } from 'authentication/selectors/authentication'; +import { useSession } from 'next-auth/client'; type LinkProps = ComponentProps; const PrivateLink: React.FC = ({ href, ...props }) => { - const isLoggedIn = useSelector(selectIsLoggedIn()); + const [session] = useSession(); // Render the href only if a user is logged in, else render a disabled link. - if (isLoggedIn) { + if (session) { return ; } else { return ; diff --git a/src/authentication/components/SilentRenew.tsx b/src/authentication/components/SilentRenew.tsx deleted file mode 100644 index 6d4addb6..00000000 --- a/src/authentication/components/SilentRenew.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import React, { useEffect, FC, useLayoutEffect } from 'react'; - -import { USER_MANAGER } from 'authentication/api'; -import { __CLIENT__ } from 'common/constants/environment'; -import { useDispatch } from 'core/redux/hooks'; -import { authenticationActions } from 'authentication/slices/authentication'; -import { IAuthUser } from 'authentication/models/User'; - -const useIsomorphicLayoutEffect = __CLIENT__ ? useLayoutEffect : useEffect; - -type JSON = string & { __JSON__: T }; -declare const JSON: { - parse: (str: JSON) => T; - stringify: (obj: T) => JSON; -}; - -export const SilentRenewComponent: FC = () => { - const dispatch = useDispatch(); - const loadCurrentUser = async () => { - if (USER_MANAGER) { - const user = await USER_MANAGER.getUser(); - if (user) dispatch(authenticationActions.userSignIn(JSON.stringify(user as IAuthUser))); - else USER_MANAGER.signinSilent(); - } - }; - - useIsomorphicLayoutEffect(() => { - loadCurrentUser(); - }, [loadCurrentUser]); - - return <>; -}; - -export const SilentRenew = SilentRenewComponent; diff --git a/src/authentication/models/User.ts b/src/authentication/models/User.ts index 6935fd1e..e6048d4d 100644 --- a/src/authentication/models/User.ts +++ b/src/authentication/models/User.ts @@ -1,9 +1,27 @@ -import { Profile, User } from 'oidc-client'; - export interface IAuthUser extends User { profile: IAuthProfile; } +interface User { + id_token: string; + session_state?: string; + access_token: string; + refresh_token?: string; + token_type: string; + profile: Profile; + expires_at: number; +} + +export interface Profile { + sub: number; + name: string; + given_name: string; + family_name: string; + nickname: string; + preferred_username: string; + picture: string; +} + interface IOnlinewebScope { field_of_study: string; member: boolean; @@ -12,11 +30,16 @@ interface IOnlinewebScope { superuser: boolean; } +interface IEmailScope { + email: string; + email_verified: boolean; +} + /** - * Profile informastion returned from authenticating with + * Profile information returned from authenticating with * OpenID Connect to Onlineweb4. */ -export type IAuthProfile = NonNullable & IOnlinewebScope; +export type IAuthProfile = NonNullable & IOnlinewebScope & Partial; export const isOnlineUser = (user: User | IAuthUser): user is IAuthUser => user.hasOwnProperty('preferred_username'); diff --git a/src/authentication/providers/AuthenticationProvider.tsx b/src/authentication/providers/AuthenticationProvider.tsx deleted file mode 100644 index e38d5aa0..00000000 --- a/src/authentication/providers/AuthenticationProvider.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import React, { FC, useCallback, useEffect } from 'react'; - -import { useDispatch } from 'core/redux/hooks'; -import { authenticationActions } from 'authentication/slices/authentication'; -import { USER_MANAGER } from 'authentication/api'; -import { User } from 'oidc-client'; -import { IAuthUser } from 'authentication/models/User'; - -type JSON = string & { __JSON__: T }; -declare const JSON: { - parse: (str: JSON) => T; - stringify: (obj: T) => JSON; -}; - -// This component registers listeners for all authentication/user-related events which adds the events to the Redux store. -const AuthenticationProviderComponent: FC = ({ children }) => { - const dispatch = useDispatch(); - - // event callback when the user has been loaded (on silent renew or redirect) - const onUserLoaded = useCallback( - (user: User) => { - dispatch(authenticationActions.userSignIn(JSON.stringify(user as IAuthUser))); - }, - [dispatch] - ); - - // event callback when silent renew errored - const onSilentRenewError = useCallback(() => { - dispatch(authenticationActions.userSilentRenewError()); - }, [dispatch]); - - // event callback when the access token expired - const onAccessTokenExpired = useCallback(() => { - dispatch(authenticationActions.userExpired()); - }, [dispatch]); - - // event callback when the user is logged out - const onUserUnloaded = useCallback(() => { - dispatch(authenticationActions.userSessionTerminated()); - }, [dispatch]); - - // event callback when the user is expiring - const onAccessTokenExpiring = useCallback(() => { - dispatch(authenticationActions.userExpired()); - }, [dispatch]); - - // event callback when the user is signed out - const onUserSignedOut = useCallback(() => { - dispatch(authenticationActions.userSignOut()); - }, [dispatch]); - - const addEventListeners = useCallback(() => { - if (USER_MANAGER) { - USER_MANAGER.events.addUserLoaded(onUserLoaded); - USER_MANAGER.events.addSilentRenewError(onSilentRenewError); - USER_MANAGER.events.addAccessTokenExpired(onAccessTokenExpired); - USER_MANAGER.events.addAccessTokenExpiring(onAccessTokenExpiring); - USER_MANAGER.events.addUserUnloaded(onUserUnloaded); - USER_MANAGER.events.addUserSignedOut(onUserSignedOut); - } - }, [onUserLoaded, onSilentRenewError, onAccessTokenExpired, onAccessTokenExpiring, onUserUnloaded, onUserSignedOut]); - - const removeEventListeners = useCallback(() => { - if (USER_MANAGER) { - USER_MANAGER.events.removeUserLoaded(onUserLoaded); - USER_MANAGER.events.removeSilentRenewError(onSilentRenewError); - USER_MANAGER.events.removeAccessTokenExpired(onAccessTokenExpired); - USER_MANAGER.events.removeAccessTokenExpiring(onAccessTokenExpiring); - USER_MANAGER.events.removeUserUnloaded(onUserUnloaded); - USER_MANAGER.events.removeUserSignedOut(onUserSignedOut); - } - }, [onUserLoaded, onSilentRenewError, onAccessTokenExpired, onAccessTokenExpiring, onUserUnloaded, onUserSignedOut]); - - useEffect(() => { - addEventListeners(); - return () => removeEventListeners(); - }, [addEventListeners]); - - return <>{children}; -}; - -export const AuthenticationProvider = React.memo(AuthenticationProviderComponent); diff --git a/src/authentication/providers/RequiresLogin.tsx b/src/authentication/providers/RequiresLogin.tsx index 7463f019..f004ab64 100644 --- a/src/authentication/providers/RequiresLogin.tsx +++ b/src/authentication/providers/RequiresLogin.tsx @@ -1,12 +1,13 @@ import React from 'react'; import LoginPage from 'pages/login'; -import { useSelector } from 'react-redux'; -import { selectIsLoggedIn } from 'authentication/selectors/authentication'; +import { useSession } from 'next-auth/client'; +import Spinner from 'common/components/Spinner'; const RequiresLogin: React.FC = (props) => { - const isLoggedIn = useSelector(selectIsLoggedIn()); + const [session, loading] = useSession(); - if (!isLoggedIn) return ; + if (loading) return ; + if (!session) return ; return <>{props.children}; }; diff --git a/src/authentication/selectors/authentication.ts b/src/authentication/selectors/authentication.ts deleted file mode 100644 index 7779df47..00000000 --- a/src/authentication/selectors/authentication.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { State } from 'core/redux/Store'; - -export const selectIsLoggedIn = () => (state: State): boolean => { - return state.authentication.loggedIn; -}; - -export const selectFullName = () => (state: State): string => { - return state.authentication.user?.name || 'Anonym bruker'; -}; - -export const selectUserImage = () => (state: State): string => { - return state.authentication.user?.picture || 'Ingen bilde'; -}; - -export const selectUserName = () => (state: State): string => { - return state.authentication.user?.preferred_username || 'anonymous'; -}; diff --git a/src/authentication/slices/authentication.ts b/src/authentication/slices/authentication.ts deleted file mode 100644 index b9e5d20d..00000000 --- a/src/authentication/slices/authentication.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { createSlice, SerializedError, PayloadAction } from '@reduxjs/toolkit'; - -import { IAuthUser, IAuthProfile } from 'authentication/models/User'; - -// https://github.com/microsoft/TypeScript/issues/27930 -type JSON = string & { __JSON__: T }; -declare const JSON: { - parse: (str: JSON) => T; - stringify: (obj: T) => JSON; -}; - -interface IState { - loading: 'idle' | 'pending'; - error: null | SerializedError; - user: IAuthProfile | null; - loggedIn: boolean; - token: string | null; -} - -const INITIAL_STATE: IState = { - loading: 'idle', - error: null, - token: null, - user: null, - loggedIn: false, -}; - -const authenticationSlice = createSlice({ - name: 'authentication', - initialState: INITIAL_STATE, - reducers: { - userExpired(state) { - state.user = null; - state.token = null; - state.loggedIn = false; - state.loading = 'idle'; - }, - userSilentRenewError(state) { - state.user = null; - state.token = null; - state.loggedIn = false; - state.loading = 'idle'; - }, - userSessionTerminated(state) { - state.user = null; - state.token = null; - state.loggedIn = false; - state.loading = 'idle'; - }, - userSignOut(state) { - state.user = null; - state.token = null; - state.loggedIn = false; - state.loading = 'idle'; - }, - userSignIn(state, action: PayloadAction>) { - // https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants - const user = JSON.parse(action.payload); - state.user = user.profile; - state.loggedIn = true; - state.token = user.access_token; - state.loading = 'idle'; - }, - userLoading(state) { - state.loading = 'pending'; - }, - }, -}); - -export const authenticationActions = authenticationSlice.actions; - -export const authenticationReducer = authenticationSlice.reducer; diff --git a/src/core/components/Header/Login.tsx b/src/core/components/Header/Login.tsx index f2b60750..7e56c395 100644 --- a/src/core/components/Header/Login.tsx +++ b/src/core/components/Header/Login.tsx @@ -5,8 +5,8 @@ import { getMyProfileUrl, getPaymentWalletUrl } from 'core/appUrls'; import { Link } from 'core/components/Router'; import style from './header.less'; -import { useSelector } from 'react-redux'; -import { selectIsLoggedIn, selectUserName } from 'authentication/selectors/authentication'; +import { useSession } from 'next-auth/client'; +import { IAuthUser } from 'authentication/models/User'; interface IProps { menuIsOpen?: boolean; @@ -15,7 +15,7 @@ interface IProps { const Login: React.FC = (props) => { const [isOpen, setIsOpen] = useState(false); - const isLoggedIn = useSelector(selectIsLoggedIn()); + const [session] = useSession(); const toggleDropdown = () => { if (props.menuIsOpen && props.closeMenu) { @@ -24,7 +24,7 @@ const Login: React.FC = (props) => { setIsOpen(!isOpen); }; - return isLoggedIn ? ( + return session ? ( ) : ( @@ -38,7 +38,8 @@ interface IHeaderUserProps { } const HeaderUser = (props: IHeaderUserProps) => { - const username = useSelector(selectUserName()); + const [session] = useSession(); + const username = ((session?.user as unknown) as IAuthUser).profile.preferred_username; return (