Skip to content

Commit

Permalink
chore(web): upgrade auth0 to version 2 (#420)
Browse files Browse the repository at this point in the history
Co-authored-by: nina992 <[email protected]>
  • Loading branch information
nina992 and nina992 authored May 17, 2023
1 parent 58632a5 commit abfb4da
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 59 deletions.
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
},
"dependencies": {
"@apollo/client": "3.7.14",
"@auth0/auth0-react": "1.12.1",
"@auth0/auth0-react": "2.1.0",
"@emotion/react": "11.11.0",
"@emotion/styled": "11.11.0",
"@floating-ui/react-dom": "2.0.0",
Expand Down
8 changes: 5 additions & 3 deletions web/src/auth/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ export default function useAuth() {
login: () => loginWithRedirect(),
logout: () =>
logout({
returnTo: error
? `${window.location.origin}?${errorKey}=${encodeURIComponent(error?.message)}`
: window.location.origin,
logoutParams: {
returnTo: error
? `${window.location.origin}?${errorKey}=${encodeURIComponent(error?.message)}`
: window.location.origin,
},
}),
};
}
Expand Down
10 changes: 6 additions & 4 deletions web/src/auth/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ const Provider: React.FC<{ children?: ReactNode }> = ({ children }) => {
<Auth0Provider
domain={domain}
clientId={clientId}
audience={audience}
authorizationParams={{
audience: audience,
scope: "openid profile email offline_access",
redirectUri: window.location.origin,
}}
useRefreshTokens
scope="openid profile email offline_access"
cacheLocation="localstorage"
redirectUri={window.location.origin}>
cacheLocation="localstorage">
{children}
</Auth0Provider>
) : (
Expand Down
62 changes: 11 additions & 51 deletions web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,17 @@
dependencies:
node-fetch "^2.6.1"

"@auth0/auth0-react@1.12.1":
version "1.12.1"
resolved "https://registry.yarnpkg.com/@auth0/auth0-react/-/auth0-react-1.12.1.tgz#3a469518828137339c635434ab953e206e798fe8"
integrity sha512-8+ecK/4rE0AGsxLW2IDcr1oPbT55tuE6cQEzEIOkQjB6QGQxxWMzQy0D4nMKw3JUAc7nYcFVOABNFNbc471n9Q==
"@auth0/auth0-react@2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@auth0/auth0-react/-/auth0-react-2.1.0.tgz#cadb561fb3994fd3e63040da1bfc714947ac07ea"
integrity sha512-+86qLx97BcSwL/ZwIzGq9jFa5SaV5z7goLU5gi+4R9KhzDg9vhmmZ+iQWW0GMiuwjJ8vcfX4hRTD6iF0DbGZWw==
dependencies:
"@auth0/auth0-spa-js" "^1.22.6"
"@auth0/auth0-spa-js" "^2.0.4"

"@auth0/auth0-spa-js@^1.22.6":
version "1.22.6"
resolved "https://registry.yarnpkg.com/@auth0/auth0-spa-js/-/auth0-spa-js-1.22.6.tgz#482c7cf546649e856020d20843cd496258bd9fa0"
integrity sha512-iL3O0vWanfKFVgy1J2ZHDPlAUK6EVHWEHWS6mUXwHEuPiK39tjlQtyUKQIJI1F5YsZB75ijGgRWMTawSDXlwCA==
dependencies:
abortcontroller-polyfill "^1.7.3"
browser-tabs-lock "^1.2.15"
core-js "^3.25.4"
es-cookie "~1.3.2"
fast-text-encoding "^1.0.6"
promise-polyfill "^8.2.3"
unfetch "^4.2.0"
"@auth0/auth0-spa-js@^2.0.4":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@auth0/auth0-spa-js/-/auth0-spa-js-2.0.4.tgz#81f6b5d9f72617ed30ee53cdf27dcd7a216bf2da"
integrity sha512-NgD6Fkm5Xnbned1VjhEW8irm1/Y8AWtdSLexgLXNwwBVgfnYicCVBu8w75m2t+4QljXkTcI7IXVEFhVmxMuxaA==

"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.21.4":
version "7.21.4"
Expand Down Expand Up @@ -4934,11 +4926,6 @@ abort-controller@^3.0.0:
dependencies:
event-target-shim "^5.0.0"

abortcontroller-polyfill@^1.7.3:
version "1.7.5"
resolved "https://registry.npmjs.org/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz"
integrity sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ==

accepts@~1.3.8:
version "1.3.8"
resolved "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz"
Expand Down Expand Up @@ -5470,13 +5457,6 @@ browser-assert@^1.2.1:
resolved "https://registry.npmjs.org/browser-assert/-/browser-assert-1.2.1.tgz"
integrity sha512-nfulgvOR6S4gt9UKCeGJOuSGBPGiFT6oQ/2UBnvTY/5aQ1PnksW72fhZkM30DzoRRv2WpwZf1vHHEr3mtuXIWQ==

browser-tabs-lock@^1.2.15:
version "1.3.0"
resolved "https://registry.npmjs.org/browser-tabs-lock/-/browser-tabs-lock-1.3.0.tgz"
integrity sha512-g6nHaobTiT0eMZ7jh16YpD2kcjAp+PInbiVq3M1x6KKaEIVhT4v9oURNIpZLOZ3LQbQ3XYfNhMAb/9hzNLIWrw==
dependencies:
lodash ">=4.17.21"

browserslist@^4.21.3:
version "4.21.4"
resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.21.4.tgz"
Expand Down Expand Up @@ -6081,7 +6061,7 @@ copy-to-clipboard@^3.2.0, copy-to-clipboard@^3.3.1:
dependencies:
toggle-selection "^1.0.6"

[email protected], core-js@^3.25.4:
[email protected]:
version "3.30.2"
resolved "https://registry.npmjs.org/core-js/-/core-js-3.30.2.tgz"
integrity sha512-uBJiDmwqsbJCWHAwjrx3cvjbMXP7xD72Dmsn5LOJpiRmE3WbBbN5rCqQ2Qh6Ek6/eOrjlWngEynBWo4VxerQhg==
Expand Down Expand Up @@ -6782,11 +6762,6 @@ es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.20.0, es-abstract@^1.20
unbox-primitive "^1.0.2"
which-typed-array "^1.1.9"

es-cookie@~1.3.2:
version "1.3.2"
resolved "https://registry.npmjs.org/es-cookie/-/es-cookie-1.3.2.tgz"
integrity sha512-UTlYYhXGLOy05P/vKVT2Ui7WtC7NiRzGtJyAKKn32g5Gvcjn7KAClLPWlipCtxIus934dFg9o9jXiBL0nP+t9Q==

es-get-iterator@^1.1.1:
version "1.1.2"
resolved "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.2.tgz"
Expand Down Expand Up @@ -7327,11 +7302,6 @@ fast-shallow-equal@^1.0.0:
resolved "https://registry.npmjs.org/fast-shallow-equal/-/fast-shallow-equal-1.0.0.tgz"
integrity sha512-HPtaa38cPgWvaCFmRNhlc6NG7pv6NUHqjPgVAkWGoB9mQMwYB27/K0CvOM5Czy+qpT3e8XJ6Q4aPAnzpNpzNaw==

fast-text-encoding@^1.0.6:
version "1.0.6"
resolved "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.6.tgz"
integrity sha512-VhXlQgj9ioXCqGstD37E/HBeqEGV/qOD/kmbVG8h5xKBYvM1L3lR1Zn4555cQ8GkYbJa8aJSipLPndE1k6zK2w==

fast-url-parser@^1.1.3:
version "1.1.3"
resolved "https://registry.npmjs.org/fast-url-parser/-/fast-url-parser-1.1.3.tgz"
Expand Down Expand Up @@ -9329,7 +9299,7 @@ lodash.startcase@^4.4.0:
resolved "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz"
integrity sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==

lodash@>=4.17.21, lodash@^4, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@~4.17.0:
lodash@^4, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@~4.17.0:
version "4.17.21"
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
Expand Down Expand Up @@ -10938,11 +10908,6 @@ promise-map-series@^0.3.0:
resolved "https://registry.npmjs.org/promise-map-series/-/promise-map-series-0.3.0.tgz"
integrity sha512-3npG2NGhTc8BWBolLLf8l/92OxMGaRLbqvIh9wjCHhDXNvk4zsxaTaCpiCunW09qWPrN2zeNSNwRLVBrQQtutA==

promise-polyfill@^8.2.3:
version "8.3.0"
resolved "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.3.0.tgz"
integrity sha512-H5oELycFml5yto/atYqmjyigJoAo3+OXwolYiH7OfQuYlAqhxNvTfiNMbV9hsC6Yp83yE5r2KTVmtrG6R9i6Pg==

promise@^7.1.1:
version "7.3.1"
resolved "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz"
Expand Down Expand Up @@ -13108,11 +13073,6 @@ undici@^5.12.0:
dependencies:
busboy "^1.6.0"

unfetch@^4.2.0:
version "4.2.0"
resolved "https://registry.npmjs.org/unfetch/-/unfetch-4.2.0.tgz"
integrity sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA==

unified@^10.0.0:
version "10.1.2"
resolved "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz"
Expand Down

0 comments on commit abfb4da

Please sign in to comment.