From 881ac70fd5dca39415750efdd1c84570d4c6f9d5 Mon Sep 17 00:00:00 2001 From: Dipendra Upreti Date: Wed, 28 Feb 2024 17:56:59 +0545 Subject: [PATCH 1/2] build(user): update supertokens-web-js version to 0.7.0 from 0.6.0 --- packages/user/package.json | 2 +- packages/user/src/supertokens/google-login.ts | 4 +- packages/user/src/supertokens/index.ts | 2 + pnpm-lock.yaml | 88 ++++++++++++++++--- 4 files changed, 83 insertions(+), 13 deletions(-) diff --git a/packages/user/package.json b/packages/user/package.json index a9bf8f92d..e6b1e0d01 100644 --- a/packages/user/package.json +++ b/packages/user/package.json @@ -28,7 +28,7 @@ "typecheck": "tsc --noEmit -p tsconfig.vitest.json --composite false" }, "dependencies": { - "supertokens-web-js": "0.6.0", + "supertokens-web-js": "0.7.0", "zod": "3.22.3" }, "devDependencies": { diff --git a/packages/user/src/supertokens/google-login.ts b/packages/user/src/supertokens/google-login.ts index b6dc2964c..dab8197e1 100644 --- a/packages/user/src/supertokens/google-login.ts +++ b/packages/user/src/supertokens/google-login.ts @@ -4,8 +4,8 @@ import { getAuthorisationURLWithQueryParamsAndSetState } from "supertokens-web-j const googleLogin = async (redirectUrl: string) => { try { const authUrl = await getAuthorisationURLWithQueryParamsAndSetState({ - authorisationURL: redirectUrl, - providerId: "google", + frontendRedirectURI: redirectUrl, + thirdPartyId: "google", }); window.location.assign(authUrl); diff --git a/packages/user/src/supertokens/index.ts b/packages/user/src/supertokens/index.ts index 5e2f96eb6..38e60aa80 100644 --- a/packages/user/src/supertokens/index.ts +++ b/packages/user/src/supertokens/index.ts @@ -1,6 +1,7 @@ import { AppConfig } from "@dzangolab/react-config"; import SuperTokens from "supertokens-web-js"; import EmailVerification from "supertokens-web-js/recipe/emailverification"; +import Multitenancy from "supertokens-web-js/recipe/multitenancy"; import Session from "supertokens-web-js/recipe/session"; import ThirdPartyEmailPassword from "supertokens-web-js/recipe/thirdpartyemailpassword"; @@ -9,6 +10,7 @@ import { SUPERTOKENS_API_BASE_PATH_DEFAULT } from "@/constants"; const superTokens = (config: AppConfig) => { // eslint-disable-next-line @typescript-eslint/no-explicit-any const recipeLists: Array = [ + Multitenancy.init(), Session.init(), ThirdPartyEmailPassword.init(), ]; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7251cfec2..db05092d2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,5 +1,9 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + importers: .: @@ -118,7 +122,7 @@ importers: version: 2.12.1(eslint@8.48.0) eslint-plugin-import: specifier: 2.27.5 - version: 2.27.5(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.48.0) + version: 2.27.5(@typescript-eslint/parser@5.62.0)(eslint@8.48.0) eslint-plugin-prettier: specifier: 5.0.0 version: 5.0.0(eslint-config-prettier@8.10.0)(eslint@8.48.0)(prettier@3.0.3) @@ -616,8 +620,8 @@ importers: packages/user: dependencies: supertokens-web-js: - specifier: 0.6.0 - version: 0.6.0 + specifier: 0.7.0 + version: 0.7.0 zod: specifier: 3.22.3 version: 3.22.3 @@ -5416,6 +5420,7 @@ packages: typescript: 5.2.2 transitivePeerDependencies: - supports-color + dev: false /@typescript-eslint/scope-manager@5.62.0: resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} @@ -7650,7 +7655,7 @@ packages: confusing-browser-globals: 1.0.11 eslint: 8.48.0 eslint-plugin-flowtype: 8.0.3(@babel/plugin-syntax-flow@7.23.3)(@babel/plugin-transform-react-jsx@7.21.0)(eslint@8.48.0) - eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.48.0) + eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.62.0)(eslint@8.48.0) eslint-plugin-jest: 25.7.0(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.48.0)(typescript@5.1.6) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.48.0) eslint-plugin-react: 7.33.2(eslint@8.48.0) @@ -7714,6 +7719,7 @@ packages: - eslint-import-resolver-node - eslint-import-resolver-webpack - supports-color + dev: false /eslint-module-utils@2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.48.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} @@ -7743,6 +7749,36 @@ packages: eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@5.62.0)(eslint-plugin-import@2.27.5)(eslint@8.48.0) transitivePeerDependencies: - supports-color + dev: false + + /eslint-module-utils@2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.9)(eslint@8.48.0): + resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: '*' + eslint-import-resolver-node: '*' + eslint-import-resolver-typescript: '*' + eslint-import-resolver-webpack: '*' + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + eslint: + optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true + dependencies: + '@typescript-eslint/parser': 5.62.0(eslint@8.48.0)(typescript@5.1.6) + debug: 3.2.7 + eslint: 8.48.0 + eslint-import-resolver-node: 0.3.9 + transitivePeerDependencies: + - supports-color + dev: true /eslint-plugin-cypress@2.12.1(eslint@8.48.0): resolution: {integrity: sha512-c2W/uPADl5kospNDihgiLc7n87t5XhUbFDoTl6CfVkmG+kDAb5Ux10V9PoLPu9N+r7znpc+iQlcmAqT1A/89HA==} @@ -7799,6 +7835,40 @@ packages: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color + dev: false + + /eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.62.0)(eslint@8.48.0): + resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + dependencies: + '@typescript-eslint/parser': 5.62.0(eslint@8.48.0)(typescript@5.1.6) + array-includes: 3.1.7 + array.prototype.flat: 1.3.2 + array.prototype.flatmap: 1.3.2 + debug: 3.2.7 + doctrine: 2.1.0 + eslint: 8.48.0 + eslint-import-resolver-node: 0.3.9 + eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.9)(eslint@8.48.0) + has: 1.0.4 + is-core-module: 2.13.1 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.values: 1.1.7 + resolve: 1.22.8 + semver: 6.3.1 + tsconfig-paths: 3.15.0 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + dev: true /eslint-plugin-jest@25.7.0(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.48.0)(typescript@5.1.6): resolution: {integrity: sha512-PWLUEXeeF7C9QGKqvdSbzLOiLTx+bno7/HC9eefePfEb257QFHg7ye3dh80AZVkaa/RQsBB1Q/ORQvg2X7F0NQ==} @@ -8619,6 +8689,7 @@ packages: resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} dependencies: resolve-pkg-maps: 1.0.0 + dev: false /giget@1.1.3: resolution: {integrity: sha512-zHuCeqtfgqgDwvXlR84UNgnJDuUHQcNI5OqWqFxxuk2BshuKbYhJWdxBsEo4PvKqoGh23lUAIvBNpChMLv7/9Q==} @@ -11525,6 +11596,7 @@ packages: /resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + dev: false /resolve@1.22.8: resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} @@ -12132,8 +12204,8 @@ packages: resolution: {integrity: sha512-r0JFBjkMIdep3Lbk3JA+MpnpuOtw4RSyrlRAbrzMcxwiYco3GFWl/daimQZ5b1forOiUODpOlXbSOljP/oyurg==} dev: false - /supertokens-web-js@0.6.0: - resolution: {integrity: sha512-2KOgWNGanh+/zpdaFQgiA9dQa6T9wA6LcoB6m1BTZ7JIqR3mYmpLD5uu8ERtISNAGUjcXziON/Fp5ZnlBByCcw==} + /supertokens-web-js@0.7.0: + resolution: {integrity: sha512-+ojphygeSEpP7D7QJz1Yf9rI+ohwkqd+ONsthrNE+yDhKhf0Y9c3thqYMhODoCiScZFlNOFh0E+NvSPcdt1dvQ==} dependencies: supertokens-js-override: 0.0.4 supertokens-website: 17.0.4 @@ -13449,7 +13521,3 @@ packages: engines: {node: '>=0.8'} hasBin: true dev: false - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false From 8fa49428142ea7b8ef15687659cbe98c325ce4d0 Mon Sep 17 00:00:00 2001 From: Dipendra Upreti Date: Thu, 7 Mar 2024 15:00:59 +0545 Subject: [PATCH 2/2] build(user): update supertokens-web-js to 0.7.2 --- packages/user/package.json | 2 +- packages/user/src/components/Login/SocialLogins.tsx | 4 ++-- pnpm-lock.yaml | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/user/package.json b/packages/user/package.json index e6b1e0d01..bedf39fec 100644 --- a/packages/user/package.json +++ b/packages/user/package.json @@ -28,7 +28,7 @@ "typecheck": "tsc --noEmit -p tsconfig.vitest.json --composite false" }, "dependencies": { - "supertokens-web-js": "0.7.0", + "supertokens-web-js": "0.7.2", "zod": "3.22.3" }, "devDependencies": { diff --git a/packages/user/src/components/Login/SocialLogins.tsx b/packages/user/src/components/Login/SocialLogins.tsx index 6364d32ed..ca17e6a50 100644 --- a/packages/user/src/components/Login/SocialLogins.tsx +++ b/packages/user/src/components/Login/SocialLogins.tsx @@ -1,9 +1,9 @@ import { useTranslation } from "@dzangolab/react-i18n"; -import { useConfig } from "@/hooks"; - import GoogleLogin from "../GoogleLogin"; +import { useConfig } from "@/hooks"; + export const SUPPORTED_SOCIAL_LOGIN_PROVIDERS = [ "google" as const, // "facebook" as const, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index db05092d2..3eb7fa602 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -620,8 +620,8 @@ importers: packages/user: dependencies: supertokens-web-js: - specifier: 0.7.0 - version: 0.7.0 + specifier: 0.7.2 + version: 0.7.2 zod: specifier: 3.22.3 version: 3.22.3 @@ -12204,8 +12204,8 @@ packages: resolution: {integrity: sha512-r0JFBjkMIdep3Lbk3JA+MpnpuOtw4RSyrlRAbrzMcxwiYco3GFWl/daimQZ5b1forOiUODpOlXbSOljP/oyurg==} dev: false - /supertokens-web-js@0.7.0: - resolution: {integrity: sha512-+ojphygeSEpP7D7QJz1Yf9rI+ohwkqd+ONsthrNE+yDhKhf0Y9c3thqYMhODoCiScZFlNOFh0E+NvSPcdt1dvQ==} + /supertokens-web-js@0.7.2: + resolution: {integrity: sha512-8TQFfuDzOkdbP/br7AHI8PJaslAYOVmHKT9rxb+v2cuFXYbZzHKoZeY12C1hepqHED8Cbt+rnIIVb2VUYlzd/w==} dependencies: supertokens-js-override: 0.0.4 supertokens-website: 17.0.4