Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V5.1.0 #208

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"firebase": "^9.9.0",
"firebase-admin": "^11.0.0",
"js-cookie": "^3.0.1",
"next": "12.2.2",
"next-fortress": "5.0.0-beta.1",
"next": "v12.2.3-canary.1",
"next-fortress": "5.1.0-beta.1",
"nookies": "^2.5.2",
"react": "^18.2.0",
"react-dom": "18.2.0"
Expand Down
224 changes: 112 additions & 112 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2527,10 +2527,10 @@
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==

"@next/[email protected].2":
version "12.2.2"
resolved "https://registry.yarnpkg.com/@next/env/-/env-12.2.2.tgz#cc1a0a445bd254499e30f632968c03192455f4cc"
integrity sha512-BqDwE4gDl1F608TpnNxZqrCn6g48MBjvmWFEmeX5wEXDXh3IkAOw6ASKUgjT8H4OUePYFqghDFUss5ZhnbOUjw==
"@next/[email protected].3-canary.1":
version "12.2.3-canary.1"
resolved "https://registry.yarnpkg.com/@next/env/-/env-12.2.3-canary.1.tgz#c656f3c3d57160f16d564e37fe60facf187c3c43"
integrity sha512-osN3C2UySFm4HMNAxc3T3JSXWOvd5YoGJ134PnUktH2IVnjg8un51Wp78FKZo8D2aifkuNS1QzfyimwiE1vFew==

"@next/[email protected]":
version "12.2.2"
Expand All @@ -2539,70 +2539,70 @@
dependencies:
glob "7.1.7"

"@next/[email protected].2":
version "12.2.2"
resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.2.2.tgz#f6c4111e6371f73af6bf80c9accb3d96850a92cd"
integrity sha512-VHjuCHeq9qCprUZbsRxxM/VqSW8MmsUtqB5nEpGEgUNnQi/BTm/2aK8tl7R4D0twGKRh6g1AAeFuWtXzk9Z/vQ==

"@next/[email protected].2":
version "12.2.2"
resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-12.2.2.tgz#b69de59c51e631a7600439e7a8993d6e82f3369e"
integrity sha512-v5EYzXUOSv0r9mO/2PX6mOcF53k8ndlu9yeFHVAWW1Dhw2jaJcvTRcCAwYYN8Q3tDg0nH3NbEltJDLKmcJOuVA==

"@next/[email protected].2":
version "12.2.2"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.2.2.tgz#80157c91668eff95b72d052428c353eab0fc4c50"
integrity sha512-JCoGySHKGt+YBk7xRTFGx1QjrnCcwYxIo3yGepcOq64MoiocTM3yllQWeOAJU2/k9MH0+B5E9WUSme4rOCBbpA==

"@next/[email protected].2":
version "12.2.2"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-12.2.2.tgz#12be2f58e676fccff3d48a62921b9927ed295133"
integrity sha512-dztDtvfkhUqiqpXvrWVccfGhLe44yQ5tQ7B4tBfnsOR6vxzI9DNPHTlEOgRN9qDqTAcFyPxvg86mn4l8bB9Jcw==

"@next/[email protected].2":
version "12.2.2"
resolved "https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.2.2.tgz#de1363431a49059f1efb8c0f86ce6a79c53b3a95"
integrity sha512-JUnXB+2xfxqsAvhFLPJpU1NeyDsvJrKoOjpV7g3Dxbno2Riu4tDKn3kKF886yleAuD/1qNTUCpqubTvbbT2VoA==

"@next/[email protected].2":
version "12.2.2"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.2.2.tgz#d5b8e0d1bb55bbd9db4d2fec018217471dc8b9e6"
integrity sha512-XeYC/qqPLz58R4pjkb+x8sUUxuGLnx9QruC7/IGkK68yW4G17PHwKI/1njFYVfXTXUukpWjcfBuauWwxp9ke7Q==

"@next/[email protected].2":
version "12.2.2"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.2.2.tgz#3bc75984e1d5ec8f59eb53702cc382d8e1be2061"
integrity sha512-d6jT8xgfKYFkzR7J0OHo2D+kFvY/6W8qEo6/hmdrTt6AKAqxs//rbbcdoyn3YQq1x6FVUUd39zzpezZntg9Naw==

"@next/[email protected].2":
version "12.2.2"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.2.2.tgz#270db73e07a18d999f61e79a917943fa5bc1ef56"
integrity sha512-rIZRFxI9N/502auJT1i7coas0HTHUM+HaXMyJiCpnY8Rimbo0495ir24tzzHo3nQqJwcflcPTwEh/DV17sdv9A==

"@next/[email protected].2":
version "12.2.2"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.2.2.tgz#e6c72fa20478552e898c434f4d4c0c5e89d2ea78"
integrity sha512-ir1vNadlUDj7eQk15AvfhG5BjVizuCHks9uZwBfUgT5jyeDCeRvaDCo1+Q6+0CLOAnYDR/nqSCvBgzG2UdFh9A==

"@next/[email protected].2":
version "12.2.2"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.2.2.tgz#b9ef9efe2c401839cdefa5e70402386aafdce15a"
integrity sha512-bte5n2GzLN3O8JdSFYWZzMgEgDHZmRz5wiispiiDssj4ik3l8E7wq/czNi8RmIF+ioj2sYVokUNa/ekLzrESWw==

"@next/[email protected].2":
version "12.2.2"
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.2.2.tgz#18fa7ec7248da3a7926a0601d9ececc53ac83157"
integrity sha512-ZUGCmcDmdPVSAlwJ/aD+1F9lYW8vttseiv4n2+VCDv5JloxiX9aY32kYZaJJO7hmTLNrprvXkb4OvNuHdN22Jg==

"@next/[email protected].2":
version "12.2.2"
resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.2.2.tgz#54936e84f4a219441d051940354da7cd3eafbb4f"
integrity sha512-v7ykeEDbr9eXiblGSZiEYYkWoig6sRhAbLKHUHQtk8vEWWVEqeXFcxmw6LRrKu5rCN1DY357UlYWToCGPQPCRA==

"@next/[email protected].2":
version "12.2.2"
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.2.2.tgz#7460be700a60d75816f01109400b51fe929d7e89"
integrity sha512-2D2iinWUL6xx8D9LYVZ5qi7FP6uLAoWymt8m8aaG2Ld/Ka8/k723fJfiklfuAcwOxfufPJI+nRbT5VcgHGzHAQ==
"@next/[email protected].3-canary.1":
version "12.2.3-canary.1"
resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.2.3-canary.1.tgz#6bc46c9783204ba568ec1a53e7ddaacdc8eb6740"
integrity sha512-TdwXsxkFMzYsyKTkDRIduAyLOu6UlPqrNoe2Y0P9HOgCI+WtnLYpZS+lg/svts1ARfaLZQvG4pSWknzpxp7u6g==

"@next/[email protected].3-canary.1":
version "12.2.3-canary.1"
resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-12.2.3-canary.1.tgz#d7337ed52fe2ff6f61a5a83acb1c67e1049e74c8"
integrity sha512-IlsTK2f2YlHWirMmWWQ8KTleZG3qzyhKFO2G4wH20hneU3r9FqFm7/8TBQ1rT7rLfmyJF1XDHeNZqmik3v7UWA==

"@next/[email protected].3-canary.1":
version "12.2.3-canary.1"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.2.3-canary.1.tgz#2d4a3b272ecf1e7c4f74740a272b598d49c905ff"
integrity sha512-xZzXWvG5jIsiLv42JfRCkux32E5S/X5uwYzwDBo8uYQJqpWYHzKBq5VaPCKj0NO3lDiOgUHRtn+KnGBKrhQUGA==

"@next/[email protected].3-canary.1":
version "12.2.3-canary.1"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-12.2.3-canary.1.tgz#c662e014dcd951104cfbca56c296b476c2a1e39b"
integrity sha512-9+p2q6EkWTY4zjC0qRjd+ZFkp5cqcK/U82mhseSxPgWN8uHhq2G9/1gAWkJ3j2GFvc+vAp/qvr3VM7nYRg0a/Q==

"@next/[email protected].3-canary.1":
version "12.2.3-canary.1"
resolved "https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.2.3-canary.1.tgz#c87d76833fb1d97221808f25efef2a8060f8758b"
integrity sha512-soPi0vcYmGeDL2LFmZZmUdUllmGZOTeLWARhq7784VyM4tcRvTbwAoYnXzPkZxjd0V0eWwDBWWGjz2njQn3Ikw==

"@next/[email protected].3-canary.1":
version "12.2.3-canary.1"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.2.3-canary.1.tgz#7ea32b5963048fe1d206c115490f561b93307ccd"
integrity sha512-oUdTdIw1qdm2b789uAy2uCf7xq13RUkGMR8AHUnZSIPX63uKFJ0pUbbLbEFWT/nyOY2wjlUC0z61p6Nefdzq1A==

"@next/[email protected].3-canary.1":
version "12.2.3-canary.1"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.2.3-canary.1.tgz#859487f52b33b097de318ddc0bcbf37f1e164734"
integrity sha512-468BjsCSETUbFG4z49ofFFInh7i3MUF2rbZQI3hup2VniJuxC4IsjhPkYMO4I25IPKfkGP8OoLz2o1SW6Fr50w==

"@next/[email protected].3-canary.1":
version "12.2.3-canary.1"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.2.3-canary.1.tgz#292aa93de2b5d4ebc91df34ebe26689793be0cb0"
integrity sha512-QEElIf+N3kaLtxSabmAotVP+tCwEJGAeCqWH+CJuGWTw3MTmKGKcN0jQdNK5RlQMMJo01WFTVEdSYzU7PQ5q0A==

"@next/[email protected].3-canary.1":
version "12.2.3-canary.1"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.2.3-canary.1.tgz#ce302c8b2e6e53cd0a5bde0aa4fccdd00b280da1"
integrity sha512-lEpMdZFd3LvzOPZFiLV5zDbtGvzkni+rQHLhlVIbxe4R6nsJGfYDjJ6eEeIJpuYUX5NvFWRXio8ODhcQlK1wAg==

"@next/[email protected].3-canary.1":
version "12.2.3-canary.1"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.2.3-canary.1.tgz#6a7914a2cc1e222ea4b674cf630276b69bd96277"
integrity sha512-AOpRyRTHEnzL2T1qhSg/6J/CJqbj29s1UiFM19Gl55i8gxJgwihxs0x4ThTMFkOBhEdYOApzNIgkH/A6IpgjZQ==

"@next/[email protected].3-canary.1":
version "12.2.3-canary.1"
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.2.3-canary.1.tgz#e8f27d1111a2ba899d5e48f06409fe503d57a630"
integrity sha512-TNnrSQ9RyyJchDNEwJ3yc87D45SePjJtm0sgoEwi0lxrxifXOfUtDKG1XfX+JdhboqvKFeByVTJWL0GuzZUm6Q==

"@next/[email protected].3-canary.1":
version "12.2.3-canary.1"
resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.2.3-canary.1.tgz#1e0317c4362dd51be2056e2c30d8efb1bd86da58"
integrity sha512-PWAqDogVhdCsMMu0/+67CtjQpE1t/tz6/rvJEioXAkHtS8vwnv4B/qy+z7iiadUNuqbNG4xkiipaSn0EYJaj0A==

"@next/[email protected].3-canary.1":
version "12.2.3-canary.1"
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.2.3-canary.1.tgz#15c155c4cceb5aa0e84b0c04e518900918ace900"
integrity sha512-liQU6A459Fi8pN3siIq2DP07auSP/AXzEL9h7l+XJmWfwHlqtHfM0J5QTRr8l4S8zixQ9lXoj4izNqJnDUa0SQ==

"@nodelib/[email protected]":
version "2.1.5"
Expand Down Expand Up @@ -2710,10 +2710,10 @@
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.0.1.tgz#d26729db850fa327b7cacc5522252194404226f5"
integrity sha512-Qm9hBEBu18wt1PO2flE7LPb30BHMQt1eQgbV76YntdNk73XZGpn3izvGTYxbGgzXKgbCjiia0uxTd3aTNQrY/g==

"@swc/[email protected].2":
version "0.4.2"
resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.4.2.tgz#ed1f6997ffbc22396665d9ba74e2a5c0a2d782f8"
integrity sha512-556Az0VX7WR6UdoTn4htt/l3zPQ7bsQWK+HqdG4swV7beUCxo/BqmvbOpUkTIm/9ih86LIf1qsUnywNL3obGHw==
"@swc/[email protected].3":
version "0.4.3"
resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.4.3.tgz#16593dfc248c53b699d4b5026040f88ddb497012"
integrity sha512-6JrF+fdUK2zbGpJIlN7G3v966PQjyx/dPt1T9km2wj+EUBqgrxCk3uX4Kct16MIm9gGxfKRcfax2hVf5jvlTzA==
dependencies:
tslib "^2.4.0"

Expand Down Expand Up @@ -4925,10 +4925,10 @@ ms@^2.1.1:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==

nanoid@^3.1.30:
version "3.3.3"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25"
integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==
nanoid@^3.3.4:
version "3.3.4"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab"
integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==

natural-compare@^1.4.0:
version "1.4.0"
Expand All @@ -4940,39 +4940,39 @@ netmask@^2.0.2:
resolved "https://registry.yarnpkg.com/netmask/-/netmask-2.0.2.tgz#8b01a07644065d536383835823bc52004ebac5e7"
integrity sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==

next-fortress@5.0.0-beta.1:
version "5.0.0-beta.1"
resolved "https://registry.yarnpkg.com/next-fortress/-/next-fortress-5.0.0-beta.1.tgz#b1319f0b8d98f74251e143bfe7113f3a9edcd545"
integrity sha512-0XDIFenSTmEO/TdVLn2HtSZcSPbR7uHtxBWylv7nvwd0FxzUGOWV07SKP6Jekb2BfbtuUWzZE7jkfdumpEMuKw==
next-fortress@5.1.0-beta.1:
version "5.1.0-beta.1"
resolved "https://registry.yarnpkg.com/next-fortress/-/next-fortress-5.1.0-beta.1.tgz#012074b63900651dde69a83ec61a7114c6710869"
integrity sha512-1ptCIcreYYGaxVpS1hXxit1oIpfqlwmrMLZU8XluhkPSz22dqfVKUs/mUTknQRM3Zie4OIunJtsoig9vv3jq5Q==
dependencies:
jose "^4.8.3"
netmask "^2.0.2"

next@12.2.2:
version "12.2.2"
resolved "https://registry.yarnpkg.com/next/-/next-12.2.2.tgz#029bf5e4a18a891ca5d05b189b7cd983fd22c072"
integrity sha512-zAYFY45aBry/PlKONqtlloRFqU/We3zWYdn2NoGvDZkoYUYQSJC8WMcalS5C19MxbCZLUVCX7D7a6gTGgl2yLg==
next@v12.2.3-canary.1:
version "12.2.3-canary.1"
resolved "https://registry.yarnpkg.com/next/-/next-12.2.3-canary.1.tgz#4e7da7792e5d715b708d8ed72815c02f547e080c"
integrity sha512-gqnEr8wYp0jgreZUiGtE9iT9X3pOcdsWatr+jkjx6vurI0zYIB4WoWQXDGY2eu9bY4woHn46yZDIjft4ZOSgqg==
dependencies:
"@next/env" "12.2.2"
"@swc/helpers" "0.4.2"
"@next/env" "12.2.3-canary.1"
"@swc/helpers" "0.4.3"
caniuse-lite "^1.0.30001332"
postcss "8.4.5"
postcss "8.4.14"
styled-jsx "5.0.2"
use-sync-external-store "1.1.0"
use-sync-external-store "1.2.0"
optionalDependencies:
"@next/swc-android-arm-eabi" "12.2.2"
"@next/swc-android-arm64" "12.2.2"
"@next/swc-darwin-arm64" "12.2.2"
"@next/swc-darwin-x64" "12.2.2"
"@next/swc-freebsd-x64" "12.2.2"
"@next/swc-linux-arm-gnueabihf" "12.2.2"
"@next/swc-linux-arm64-gnu" "12.2.2"
"@next/swc-linux-arm64-musl" "12.2.2"
"@next/swc-linux-x64-gnu" "12.2.2"
"@next/swc-linux-x64-musl" "12.2.2"
"@next/swc-win32-arm64-msvc" "12.2.2"
"@next/swc-win32-ia32-msvc" "12.2.2"
"@next/swc-win32-x64-msvc" "12.2.2"
"@next/swc-android-arm-eabi" "12.2.3-canary.1"
"@next/swc-android-arm64" "12.2.3-canary.1"
"@next/swc-darwin-arm64" "12.2.3-canary.1"
"@next/swc-darwin-x64" "12.2.3-canary.1"
"@next/swc-freebsd-x64" "12.2.3-canary.1"
"@next/swc-linux-arm-gnueabihf" "12.2.3-canary.1"
"@next/swc-linux-arm64-gnu" "12.2.3-canary.1"
"@next/swc-linux-arm64-musl" "12.2.3-canary.1"
"@next/swc-linux-x64-gnu" "12.2.3-canary.1"
"@next/swc-linux-x64-musl" "12.2.3-canary.1"
"@next/swc-win32-arm64-msvc" "12.2.3-canary.1"
"@next/swc-win32-ia32-msvc" "12.2.3-canary.1"
"@next/swc-win32-x64-msvc" "12.2.3-canary.1"

[email protected], node-fetch@^2.6.7:
version "2.6.7"
Expand Down Expand Up @@ -5209,14 +5209,14 @@ picomatch@^2.2.3:
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972"
integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==

[email protected].5:
version "8.4.5"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.5.tgz#bae665764dfd4c6fcc24dc0fdf7e7aa00cc77f95"
integrity sha512-jBDboWM8qpaqwkMwItqTQTiFikhs/67OYVvblFFTM7MrZjt6yMKd6r2kgXizEbTTljacm4NldIlZnhbjr84QYg==
[email protected].14:
version "8.4.14"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf"
integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==
dependencies:
nanoid "^3.1.30"
nanoid "^3.3.4"
picocolors "^1.0.0"
source-map-js "^1.0.1"
source-map-js "^1.0.2"

prelude-ls@^1.2.1:
version "1.2.1"
Expand Down Expand Up @@ -5559,7 +5559,7 @@ slash@^3.0.0:
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==

source-map-js@^1.0.1:
source-map-js@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
Expand Down Expand Up @@ -5850,10 +5850,10 @@ url@^0.11.0:
punycode "1.3.2"
querystring "0.2.0"

use-sync-external-store@1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.1.0.tgz#3343c3fe7f7e404db70f8c687adf5c1652d34e82"
integrity sha512-SEnieB2FPKEVne66NpXPd1Np4R1lTNKfjuy3XdIoPQKYBAFdzbzSZlSn1KJZUiihQLQC5Znot4SBz1EOTBwQAQ==
use-sync-external-store@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a"
integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==

util-deprecate@^1.0.1, util-deprecate@~1.0.1:
version "1.0.2"
Expand Down
5 changes: 3 additions & 2 deletions src/__tests__/firebase.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,16 @@ vi.mock('../handle-fallback', () => ({
handleFallback: vi.fn()
}))

const event = {} as NextFetchEvent
const event = { waitUntil: () => {} } as unknown as NextFetchEvent

const fallback: Fallback = { type: 'redirect', destination: '/foo' }

const originalEnv = { ...process.env }

describe('makeFirebaseInspector', () => {
beforeEach(() => {
beforeEach(async () => {
vi.resetAllMocks()
await caches.delete('cache:firebase')
process.env = originalEnv
})

Expand Down
21 changes: 15 additions & 6 deletions src/firebase.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Fallback } from './types'
import { FIREBASE_COOKIE_KEY } from './constants'
import { NextRequest, NextMiddleware } from 'next/server'
import { NextRequest, NextMiddleware, NextFetchEvent } from 'next/server'
import { handleFallback } from './handle-fallback'
import { decodeProtectedHeader, jwtVerify, importX509 } from 'jose'

Expand All @@ -10,14 +10,15 @@ export const makeFirebaseInspector = (
customHandler?: (payload: any) => boolean
): NextMiddleware => {
return async (request, event) => {
const ok = await verifyFirebaseIdToken(request, customHandler)
const ok = await verifyFirebaseIdToken(request, event, customHandler)
if (ok) return
return handleFallback(fallback, request, event)
}
}

const verifyFirebaseIdToken = async (
req: NextRequest,
event: NextFetchEvent,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
customHandler?: (payload: any) => boolean
): Promise<boolean> => {
Expand All @@ -26,15 +27,23 @@ const verifyFirebaseIdToken = async (
const token = req.cookies.get(cookieKey)
if (!token) return false

const endpoint =
const endpoint = new URL(
process.env.FORTRESS_FIREBASE_MODE === 'session'
? 'https://www.googleapis.com/identitytoolkit/v3/relyingparty/publicKeys'
: 'https://www.googleapis.com/robot/v1/metadata/x509/[email protected]'
)
const cache = await caches.open('cache:firebase')
let jwkRes = await cache.match(endpoint)
if (!jwkRes) {
console.log('cache not hit')
jwkRes = await fetch(endpoint)
event.waitUntil(cache.put(endpoint, jwkRes.clone()))
} else {
console.log('cache hit')
}

try {
const keys: Record<string, string> = await fetch(endpoint).then((res) =>
res.json()
)
const keys: Record<string, string> = await jwkRes.json()
const { kid = '' } = decodeProtectedHeader(token)

return jwtVerify(token, await importX509(keys[kid], 'RS256'))
Expand Down