From 388c97993db2a8be636cf6874040f3f5c8cc1ca5 Mon Sep 17 00:00:00 2001 From: ethella Date: Wed, 3 Sep 2025 15:11:37 -0700 Subject: [PATCH 1/6] remove oauth package from mono-repo --- packages/@magic-ext/oauth/.lintstagedrc.yml | 2 - packages/@magic-ext/oauth/.prettierrc.js | 1 - packages/@magic-ext/oauth/CHANGELOG.md | 896 -------------------- packages/@magic-ext/oauth/LICENSE | 176 ---- packages/@magic-ext/oauth/README.md | 76 -- packages/@magic-ext/oauth/eslint.config.mjs | 21 - packages/@magic-ext/oauth/package.json | 38 - packages/@magic-ext/oauth/src/crypto.ts | 77 -- packages/@magic-ext/oauth/src/index.cdn.ts | 8 - packages/@magic-ext/oauth/src/index.ts | 121 --- packages/@magic-ext/oauth/src/types.ts | 109 --- packages/@magic-ext/oauth/tsconfig.json | 4 - 12 files changed, 1529 deletions(-) delete mode 100644 packages/@magic-ext/oauth/.lintstagedrc.yml delete mode 100644 packages/@magic-ext/oauth/.prettierrc.js delete mode 100644 packages/@magic-ext/oauth/CHANGELOG.md delete mode 100644 packages/@magic-ext/oauth/LICENSE delete mode 100644 packages/@magic-ext/oauth/README.md delete mode 100644 packages/@magic-ext/oauth/eslint.config.mjs delete mode 100644 packages/@magic-ext/oauth/package.json delete mode 100644 packages/@magic-ext/oauth/src/crypto.ts delete mode 100644 packages/@magic-ext/oauth/src/index.cdn.ts delete mode 100644 packages/@magic-ext/oauth/src/index.ts delete mode 100644 packages/@magic-ext/oauth/src/types.ts delete mode 100644 packages/@magic-ext/oauth/tsconfig.json diff --git a/packages/@magic-ext/oauth/.lintstagedrc.yml b/packages/@magic-ext/oauth/.lintstagedrc.yml deleted file mode 100644 index 1c250ad65..000000000 --- a/packages/@magic-ext/oauth/.lintstagedrc.yml +++ /dev/null @@ -1,2 +0,0 @@ -'*.{ts,tsx}': - - eslint --fix diff --git a/packages/@magic-ext/oauth/.prettierrc.js b/packages/@magic-ext/oauth/.prettierrc.js deleted file mode 100644 index 6177cac66..000000000 --- a/packages/@magic-ext/oauth/.prettierrc.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../../../.prettierrc.js'); diff --git a/packages/@magic-ext/oauth/CHANGELOG.md b/packages/@magic-ext/oauth/CHANGELOG.md deleted file mode 100644 index e600796f5..000000000 --- a/packages/@magic-ext/oauth/CHANGELOG.md +++ /dev/null @@ -1,896 +0,0 @@ -# v23.0.7 (Tue Apr 29 2025) - -#### ๐Ÿ› Bug Fix - -- Revert "Remove Extension class and rename InternalExtension to MagicExtension" [#882](https://github.com/magiclabs/magic-js/pull/882) ([@Ethella](https://github.com/Ethella)) -- Remove Extension class and rename InternalExtension to MagicExtension [#881](https://github.com/magiclabs/magic-js/pull/881) ([@devin-ai-integration[bot]](https://github.com/devin-ai-integration[bot]) [@Ethella](https://github.com/Ethella)) - -#### Authors: 2 - -- [@devin-ai-integration[bot]](https://github.com/devin-ai-integration[bot]) -- Jerry Liu ([@Ethella](https://github.com/Ethella)) - ---- - -# v23.0.5 (Tue Apr 01 2025) - -#### ๐Ÿ› Bug Fix - -- Merge remote-tracking branch 'origin/master' into PDEEXP-2318-imx-dont-throw-error-if-the-iframe-is-failing ([@Ethella](https://github.com/Ethella)) - -#### Authors: 1 - -- Jerry Liu ([@Ethella](https://github.com/Ethella)) - ---- - -# v23.0.3 (Mon Mar 24 2025) - -#### ๐Ÿ› Bug Fix - -- bump crypto-js [#864](https://github.com/magiclabs/magic-js/pull/864) ([@Ethella](https://github.com/Ethella)) -- address deepsource suggestion ([@Ethella](https://github.com/Ethella)) -- Merge remote-tracking branch 'origin/master' into bump-cryptojs ([@Ethella](https://github.com/Ethella)) -- bump crypto-js ([@Ethella](https://github.com/Ethella)) - -#### Authors: 1 - -- Jerry Liu ([@Ethella](https://github.com/Ethella)) - ---- - -# v22.20.0 (Wed Jan 08 2025) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into hcote-web3modal ([@hcote](https://github.com/hcote)) - -#### Authors: 1 - -- Hunter Cote ([@hcote](https://github.com/hcote)) - ---- - -# v22.19.0 (Wed Dec 25 2024) - -#### ๐Ÿ› Bug Fix - -- Merge remote-tracking branch 'origin/master' into PDEEXP-530-wallet-connect-login-with-redirect ([@Ethella](https://github.com/Ethella)) -- revert change ([@Ethella](https://github.com/Ethella)) -- revert changes ([@Ethella](https://github.com/Ethella)) -- resolve conflict ([@Ethella](https://github.com/Ethella)) -- * fix deepsource ([@Ethella](https://github.com/Ethella)) -- * resolve conflict ([@Ethella](https://github.com/Ethella)) -- Merge branch 'master' into PDEEXP-530-wallet-connect-login-with-redirect ([@mattupham](https://github.com/mattupham)) -- add optional queryString ([@mattupham](https://github.com/mattupham)) -- add redirect to OAuth v2 ([@mattupham](https://github.com/mattupham)) - -#### Authors: 2 - -- Jerry Liu ([@Ethella](https://github.com/Ethella)) -- Matt Upham ([@mattupham](https://github.com/mattupham)) - ---- - -# v22.18.1 (Thu Dec 05 2024) - -#### ๐Ÿ› Bug Fix - -- fix: typos [#830](https://github.com/magiclabs/magic-js/pull/830) ([@omahs](https://github.com/omahs) [@Ethella](https://github.com/Ethella)) -- chore: bump eslint version [#834](https://github.com/magiclabs/magic-js/pull/834) ([@otabek-magic](https://github.com/otabek-magic) [@Ethella](https://github.com/Ethella)) -- Merge branch 'master' into PDEEXP-1985-bump-magic-sdk-eslint-version-to-9 ([@otabek-magic](https://github.com/otabek-magic)) -- chore: update eslint config ([@otabek-magic](https://github.com/otabek-magic)) -- chore: update to eslint 9 in magic-sdk magic-ext ([@otabek-magic](https://github.com/otabek-magic)) -- Merge branch 'master' into patch-1 ([@Ethella](https://github.com/Ethella)) - -#### Authors: 3 - -- [@otabek-magic](https://github.com/otabek-magic) -- Jerry Liu ([@Ethella](https://github.com/Ethella)) -- omahs ([@omahs](https://github.com/omahs)) - ---- - -# v22.18.0 (Mon Nov 25 2024) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into PDEEXP-1954-OAuth-popup-flow-consolidation ([@sherzod-bakhodirov](https://github.com/sherzod-bakhodirov)) - -#### Authors: 1 - -- [@sherzod-bakhodirov](https://github.com/sherzod-bakhodirov) - ---- - -# v22.16.0 (Fri Oct 25 2024) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into PDEEXP-1951-Lost-Device-Event-Does-Not-Emit-Whitelabel-MFA-provider ([@Ethella](https://github.com/Ethella)) - -#### Authors: 1 - -- Jerry Liu ([@Ethella](https://github.com/Ethella)) - ---- - -# v22.15.0 (Fri Oct 25 2024) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into cancel-event-for-recovery-flow ([@sukhrobbekodilov](https://github.com/sukhrobbekodilov)) - -#### Authors: 1 - -- [@sukhrobbekodilov](https://github.com/sukhrobbekodilov) - ---- - -# v22.14.0 (Fri Oct 18 2024) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into missed_type_for_recovery_factor ([@sukhrobbekodilov](https://github.com/sukhrobbekodilov)) - -#### Authors: 1 - -- [@sukhrobbekodilov](https://github.com/sukhrobbekodilov) - ---- - -# v22.13.0 (Fri Oct 18 2024) - -#### ๐Ÿ› Bug Fix - -- Update .deepsource.toml [#804](https://github.com/magiclabs/magic-js/pull/804) ([@Magic-Brandan](https://github.com/Magic-Brandan)) - -#### Authors: 1 - -- [@Magic-Brandan](https://github.com/Magic-Brandan) - ---- - -# v22.11.0 (Wed Sep 25 2024) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into sherzod-PDEEXP-1711-Support-MFA-setup-whitelabel-support ([@sherzod-bakhodirov](https://github.com/sherzod-bakhodirov)) - -#### Authors: 1 - -- [@sherzod-bakhodirov](https://github.com/sherzod-bakhodirov) - ---- - -# v22.9.0 (Wed Sep 11 2024) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into sherzod-PDEEXP-1711-Support-MFA-setup-whitelabel-support ([@sherzod-bakhodirov](https://github.com/sherzod-bakhodirov)) -- Merge branch 'master' into hcote-cosmos-options ([@hcote](https://github.com/hcote)) - -#### Authors: 2 - -- [@sherzod-bakhodirov](https://github.com/sherzod-bakhodirov) -- Hunter Cote ([@hcote](https://github.com/hcote)) - ---- - -# v22.6.0 (Tue Sep 03 2024) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' of https://github.com/magiclabs/magic-js into khamdam-sc-PDEEXP-54-whitelabel-sms-login ([@khamdam-magic](https://github.com/khamdam-magic)) -- fix: update branch ([@khamdam-magic](https://github.com/khamdam-magic)) -- fix: resolve PR conflicts ([@khamdam-magic](https://github.com/khamdam-magic)) -- fix(): resolve conflicts ([@khamdam-magic](https://github.com/khamdam-magic)) - -#### Authors: 1 - -- [@khamdam-magic](https://github.com/khamdam-magic) - ---- - -# v22.4.0 (Tue Aug 13 2024) - -#### ๐Ÿ› Bug Fix - -- Merge remote-tracking branch 'refs/remotes/origin/master' into Add-two-more-mfa-flags ([@Ethella](https://github.com/Ethella)) - -#### Authors: 1 - -- Jerry Liu ([@Ethella](https://github.com/Ethella)) - ---- - -# v22.3.0 (Thu Aug 08 2024) - -#### ๐Ÿš€ Enhancement - -- Chore/pdeexp 1658 update login sdk method to handle did lifespan [#775](https://github.com/magiclabs/magic-js/pull/775) ([@otabek-magic](https://github.com/otabek-magic)) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into khamdam-sc-PDEEXP-54-whitelabel-sms-types ([@khamdam-magic](https://github.com/khamdam-magic)) -- Merge branch 'master' into PDEEXP-1393-MFA-Blocks-Login-for-Whitelabel-Email-Logins ([@sukhrobbekodilov](https://github.com/sukhrobbekodilov)) -- fix: remove lifespan from loginWithPopup and loginWithRedirect as they don't return did token ([@otabek-magic](https://github.com/otabek-magic)) -- Merge branch 'master' into PDEEXP-1454-typescript-should-recognize-the-disconnect-event-on-show-ui ([@sukhrobbekodilov](https://github.com/sukhrobbekodilov)) -- add lifespan parameter to login methods [#771](https://github.com/magiclabs/magic-js/pull/771) ([@otabek-magic](https://github.com/otabek-magic)) -- fix: make lifespan parameter optional ([@otabek-magic](https://github.com/otabek-magic)) -- add lifespan parameter to login methods ([@otabek-magic](https://github.com/otabek-magic)) - -#### Authors: 3 - -- [@khamdam-magic](https://github.com/khamdam-magic) -- [@otabek-magic](https://github.com/otabek-magic) -- [@sukhrobbekodilov](https://github.com/sukhrobbekodilov) - ---- - -# v22.0.5 (Thu Jun 06 2024) - -#### ๐Ÿ› Bug Fix - -- Merge remote-tracking branch 'refs/remotes/origin/master' into PDEEXP-1279-done-event-not-firing-in-whitelabel-email-login-flow ([@Ethella](https://github.com/Ethella)) - -#### Authors: 1 - -- Jerry Liu ([@Ethella](https://github.com/Ethella)) - ---- - -# v22.0.1 (Fri Mar 22 2024) - -#### ๐Ÿ› Bug Fix - -- Pdeexp 681 fix magic js launching script [#729](https://github.com/magiclabs/magic-js/pull/729) ([@Ethella](https://github.com/Ethella)) -- test package release ([@Ethella](https://github.com/Ethella)) - -#### Authors: 1 - -- Jerry Liu ([@Ethella](https://github.com/Ethella)) - ---- - -# v22.0.0 (Fri Mar 22 2024) - -#### ๐Ÿš€ Enhancement - -- Add private key reveal method [#699](https://github.com/magiclabs/magic-js/pull/699) ([@joshuascan](https://github.com/joshuascan)) - -#### ๐Ÿ› Bug Fix - -- "Bump independent versions \[skip ci\]" (team@magic.link) -- Update CHANGELOG.md \[skip ci\] (team@magic.link) -- Merge branch 'master' into patjacobs-oauth-v2-apple ([@patjacobs-magic](https://github.com/patjacobs-magic)) -- Merge branch 'master' into joshscanlan-pk-reveal-method ([@joshuascan](https://github.com/joshuascan)) - -#### Authors: 3 - -- [@patjacobs-magic](https://github.com/patjacobs-magic) -- Josh Scanlan ([@joshuascan](https://github.com/joshuascan)) -- Magic Labs (team@magic.link) - ---- - -# v21.0.0 (Fri Mar 15 2024) - -#### ๐Ÿ› Bug Fix - -- "Bump independent versions \[skip ci\]" (team@magic.link) -- Update CHANGELOG.md \[skip ci\] (team@magic.link) -- Merge branch 'master' into patjacobs-oauth-v2-apple ([@patjacobs-magic](https://github.com/patjacobs-magic)) - -#### Authors: 2 - -- [@patjacobs-magic](https://github.com/patjacobs-magic) -- Magic Labs (team@magic.link) - ---- - -# v20.0.0 (Sat Mar 09 2024) - -#### ๐Ÿ› Bug Fix - -- "Bump independent versions \[skip ci\]" (team@magic.link) -- Update CHANGELOG.md \[skip ci\] (team@magic.link) -- Merge branch 'master' into patjacobs-oauth-v2-apple ([@patjacobs-magic](https://github.com/patjacobs-magic)) - -#### Authors: 2 - -- [@patjacobs-magic](https://github.com/patjacobs-magic) -- Magic Labs (team@magic.link) - ---- - -# v19.0.0 (Thu Feb 29 2024) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into patjacobs-oauth-v2-apple ([@patjacobs-magic](https://github.com/patjacobs-magic)) -- "Bump independent versions \[skip ci\]" (team@magic.link) -- Update CHANGELOG.md \[skip ci\] (team@magic.link) - -#### Authors: 2 - -- [@patjacobs-magic](https://github.com/patjacobs-magic) -- Magic Labs (team@magic.link) - ---- - -# v18.0.0 (Tue Feb 27 2024) - -#### ๐Ÿ› Bug Fix - -- "Bump independent versions \[skip ci\]" (team@magic.link) - -#### Authors: 1 - -- Magic Labs (team@magic.link) - ---- - -# v16.1.1 (Sat Feb 10 2024) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into PDEEXP-253-whitelabel-update-email-with-ui-missing-event-when-email-address-already-in-use ([@joshuascan](https://github.com/joshuascan)) - -#### Authors: 1 - -- Josh Scanlan ([@joshuascan](https://github.com/joshuascan)) - ---- - -# v15.6.0 (Tue Jan 02 2024) - -#### ๐Ÿ› Bug Fix - -- Merge remote-tracking branch 'origin/master' into rominhalltari-sc-91336-look-into-faster-calls-to-isloggedin-and (rominhalltari@rohat92phx.lan) -- Fix: use default import of crypto-js to fix unresolved imports after build [#694](https://github.com/magiclabs/magic-js/pull/694) ([@romin-halltari](https://github.com/romin-halltari)) -- Fix: use default import of crypto-js to fix unresolved imports after build ([@romin-halltari](https://github.com/romin-halltari)) -- Merge remote-tracking branch 'origin/master' into rominhalltari-sc-91336-look-into-faster-calls-to-isloggedin-and ([@romin-halltari](https://github.com/romin-halltari)) - -#### Authors: 2 - -- [@romin-halltari](https://github.com/romin-halltari) -- Romin Halltari (rominhalltari@rohat92phx.lan) - ---- - -# v15.5.0 (Fri Dec 22 2023) - -#### ๐Ÿš€ Enhancement - -- Fix type mismatch for signMessage in solana-ext [#691](https://github.com/magiclabs/magic-js/pull/691) ([@octave08](https://github.com/octave08)) - -#### ๐Ÿ› Bug Fix - -- move crypto-js to dependencies [#692](https://github.com/magiclabs/magic-js/pull/692) ([@Ethella](https://github.com/Ethella)) -- move crypto-js to dependencies ([@Ethella](https://github.com/Ethella)) - -#### Authors: 2 - -- Jay Hwang ([@octave08](https://github.com/octave08)) -- Jerry Liu ([@Ethella](https://github.com/Ethella)) - ---- - -# v15.4.1 (Fri Dec 15 2023) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into rominhalltari-sc-91530-investigate-and-provide-solution-for-issue ([@romin-halltari](https://github.com/romin-halltari)) - -#### Authors: 1 - -- [@romin-halltari](https://github.com/romin-halltari) - ---- - -# v15.4.0 (Thu Dec 14 2023) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into split-key-device-share ([@Dizigen](https://github.com/Dizigen)) - -#### Authors: 1 - -- David He ([@Dizigen](https://github.com/Dizigen)) - ---- - -# v15.3.2 (Tue Nov 28 2023) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into josh-sc-90794-add-types-export-to-scaffolding ([@joshuascan](https://github.com/joshuascan)) - -#### Authors: 1 - -- Josh Scanlan ([@joshuascan](https://github.com/joshuascan)) - ---- - -# v15.3.1 (Tue Nov 21 2023) - -#### ๐Ÿ› Bug Fix - -- Fix TypeScript resolution for @magic-ext/* packages when using modern module resolution (node16 etc) [#670](https://github.com/magiclabs/magic-js/pull/670) ([@rjwebb](https://github.com/rjwebb) [@joshuascan](https://github.com/joshuascan)) -- Merge branch 'master' into rjwebb/669-fix-node16-magic-ext-imports ([@joshuascan](https://github.com/joshuascan)) -- Update package.json exports to expose types when using node16 typescript, for algorand, auth, avalanche, bitcoin, conflux, cosmos, ed25519, flow, gdkms, harmony, hedera, icon, near, oauth, oidc, polkadot, react-native-bare-oauth, react-native-expo-oauth, taquito, terra, tezos, webauthn and zilliqa ([@rjwebb](https://github.com/rjwebb)) - -#### Authors: 2 - -- Bob Webb ([@rjwebb](https://github.com/rjwebb)) -- Josh Scanlan ([@joshuascan](https://github.com/joshuascan)) - ---- - -# v15.2.1 (Tue Nov 14 2023) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into injectable-webcrypto-jwt-for-session-persistence ([@Dizigen](https://github.com/Dizigen)) - -#### Authors: 1 - -- David He ([@Dizigen](https://github.com/Dizigen)) - ---- - -# v15.2.0 (Tue Oct 24 2023) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into hcote-support-sepolia-natively ([@hcote](https://github.com/hcote)) - -#### Authors: 1 - -- Hunter Cote ([@hcote](https://github.com/hcote)) - ---- - -# v15.0.0 (Fri Oct 13 2023) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into force-ctor-preload-iframe ([@Dizigen](https://github.com/Dizigen)) - -#### Authors: 1 - -- David He ([@Dizigen](https://github.com/Dizigen)) - ---- - -# v14.1.2 (Sat Oct 07 2023) - -#### ๐Ÿ› Bug Fix - -- Fix crypto-js type [#641](https://github.com/magiclabs/magic-js/pull/641) ([@ysm-dev](https://github.com/ysm-dev)) -- fix type ([@ysm-dev](https://github.com/ysm-dev)) -- Fix crypto-js type ([@ysm-dev](https://github.com/ysm-dev)) - -#### Authors: 1 - -- Chris Yang ([@ysm-dev](https://github.com/ysm-dev)) - ---- - -# v14.1.1 (Mon Oct 02 2023) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into patjacobs-sc-83016-ux-optimization-expired-email-otps ([@patjacobs-magic](https://github.com/patjacobs-magic)) - -#### Authors: 1 - -- [@patjacobs-magic](https://github.com/patjacobs-magic) - ---- - -# v14.1.0 (Fri Sep 29 2023) - -#### ๐Ÿ› Bug Fix - -- Merge remote-tracking branch 'origin/master' into jerryliu-sc-87830-optimize-webcrypto-implementation-to-generate ([@Ethella](https://github.com/Ethella)) - -#### Authors: 1 - -- Jerry Liu ([@Ethella](https://github.com/Ethella)) - ---- - -# v14.0.2 (Wed Sep 20 2023) - -#### ๐Ÿ› Bug Fix - -- Update @magic-ext/oauth crypto-js es module dependency [#627](https://github.com/magiclabs/magic-js/pull/627) ([@ysm-dev](https://github.com/ysm-dev)) -- fix type ([@ysm-dev](https://github.com/ysm-dev)) -- Fix @magic-ext/oauth crypto-js es module dependency ([@ysm-dev](https://github.com/ysm-dev)) - -#### Authors: 1 - -- Chris Yang ([@ysm-dev](https://github.com/ysm-dev)) - ---- - -# v13.4.0 (Thu Sep 14 2023) - -#### ๐Ÿ› Bug Fix - -- import extension from @magic-sdk/commons instead of magick-sdk [#618](https://github.com/magiclabs/magic-js/pull/618) ([@Dizigen](https://github.com/Dizigen)) -- move crypto-js to dependencies ([@Dizigen](https://github.com/Dizigen)) -- update package dependencies ([@Dizigen](https://github.com/Dizigen)) -- import extension from @magic-sdk/commons instead of magick-sdk ([@Dizigen](https://github.com/Dizigen)) - -#### Authors: 1 - -- David He ([@Dizigen](https://github.com/Dizigen)) - ---- - -# v13.3.0 (Wed Aug 16 2023) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into josh-sc-75022-standalone-update-email-v2 ([@joshuascan](https://github.com/joshuascan)) - -#### Authors: 1 - -- Josh Scanlan ([@joshuascan](https://github.com/joshuascan)) - ---- - -# v13.1.0 (Tue Aug 08 2023) - -#### ๐Ÿ› Bug Fix - -- Merge remote-tracking branch 'origin/master' into jerryliu-sc-81984-update-loginwithemailotp-interface-with-new ([@Ethella](https://github.com/Ethella)) -- Merge remote-tracking branch 'origin/master' ([@Ethella](https://github.com/Ethella)) - -#### Authors: 1 - -- Jerry Liu ([@Ethella](https://github.com/Ethella)) - ---- - -# v12.3.0 (Fri Jul 07 2023) - -#### โš ๏ธ Pushed to `master` - -- Merge remote-tracking branch 'origin/master' ([@Ethella](https://github.com/Ethella)) - -#### Authors: 1 - -- Jerry Liu ([@Ethella](https://github.com/Ethella)) - ---- - -# v12.2.0 (Fri Jun 23 2023) - -#### ๐Ÿš€ Enhancement - -- Auto version bumping [#557](https://github.com/magiclabs/magic-js/pull/557) ([@Ethella](https://github.com/Ethella) [@Ariflo](https://github.com/Ariflo)) -- Updates License to Apache 2.0 [#551](https://github.com/magiclabs/magic-js/pull/551) ([@Ariflo](https://github.com/Ariflo)) - -#### ๐Ÿ› Bug Fix - -- Match NPM Version ([@Ariflo](https://github.com/Ariflo)) -- Update CHANGELOG.md \[skip ci\] ([@Ethella](https://github.com/Ethella)) -- Replace `magic-sdk` w/ `@magic-sdk/commons` for `@magic-ext/oidc` Package [#550](https://github.com/magiclabs/magic-js/pull/550) ([@Ariflo](https://github.com/Ariflo)) -- Updates License to Apache 2.0 ([@Ariflo](https://github.com/Ariflo)) - -#### Authors: 2 - -- Arian Flores ([@Ariflo](https://github.com/Ariflo)) -- Jerry Liu ([@Ethella](https://github.com/Ethella)) - ---- - -# v12.1.0 (Fri Jun 23 2023) - -#### ๐Ÿš€ Enhancement - -- Updates License to Apache 2.0 [#551](https://github.com/magiclabs/magic-js/pull/551) ([@Ariflo](https://github.com/Ariflo)) - -#### ๐Ÿ› Bug Fix - -- Replace `magic-sdk` w/ `@magic-sdk/commons` for `@magic-ext/oidc` Package [#550](https://github.com/magiclabs/magic-js/pull/550) ([@Ariflo](https://github.com/Ariflo)) -- Updates License to Apache 2.0 ([@Ariflo](https://github.com/Ariflo)) - -#### Authors: 1 - -- Arian Flores ([@Ariflo](https://github.com/Ariflo)) - ---- - -# v11.3.0 (Fri May 26 2023) - -#### ๐Ÿ› Bug Fix - -- Merge remote-tracking branch 'origin/master' into jerryliu_hotfix_gdkms ([@Ethella](https://github.com/Ethella)) - -#### Authors: 1 - -- Jerry Liu ([@Ethella](https://github.com/Ethella)) - ---- - -# v11.1.6 (Fri May 19 2023) - -#### ๐Ÿ› Bug Fix - -- Merge remote-tracking branch 'origin/master' into jerryliu-sc-77755-kresus-hotfix ([@Ethella](https://github.com/Ethella)) - -#### Authors: 1 - -- Jerry Liu ([@Ethella](https://github.com/Ethella)) - ---- - -# v11.1.1 (Fri Apr 21 2023) - -#### ๐Ÿ› Bug Fix - -- Merge remote-tracking branch 'origin/master' into jerryliu-sc-75641-lazer-request-showsettings-page-mfa ([@Ethella](https://github.com/Ethella)) - -#### Authors: 1 - -- Jerry Liu ([@Ethella](https://github.com/Ethella)) - ---- - -# v11.1.0 (Thu Apr 20 2023) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into jerryliu-sc-75641-lazer-request-showsettings-page-mfa ([@Ethella](https://github.com/Ethella)) - -#### Authors: 1 - -- Jerry Liu ([@Ethella](https://github.com/Ethella)) - ---- - -# v10.1.0 (Tue Apr 04 2023) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into briancleary7114-sc-73967-auto-publish-canary-version-for-magic-sdk ([@bcleary06](https://github.com/bcleary06)) - -#### Authors: 1 - -- Brian Cleary ([@bcleary06](https://github.com/bcleary06)) - ---- - -# v10.0.0 (Fri Mar 31 2023) - -#### ๐Ÿ› Bug Fix - -- Merge remote-tracking branch 'origin/master' into jerryliu-sc-74424-email-otp-login-invalid-email-otp-event ([@Ethella](https://github.com/Ethella)) - -#### Authors: 1 - -- Jerry Liu ([@Ethella](https://github.com/Ethella)) - ---- - -# v7.6.2 (Tue Mar 21 2023) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into briancleary7114-sc-71135-add-checkout-sdk-method ([@bcleary06](https://github.com/bcleary06)) - -#### Authors: 1 - -- Brian Cleary ([@bcleary06](https://github.com/bcleary06)) - ---- - -# v7.5.0 (Tue Feb 28 2023) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' of github.com:magiclabs/magic-js into mushfichowdhury-login-with-email-otp-whitelabel ([@mushfichowdhury-magic](https://github.com/mushfichowdhury-magic)) - -#### Authors: 1 - -- Mushfi Chowdhury ([@mushfichowdhury-magic](https://github.com/mushfichowdhury-magic)) - ---- - -# v7.4.0 (Tue Feb 21 2023) - -#### ๐Ÿš€ Enhancement - -- * Add recoverAccount api [#458](https://github.com/magiclabs/magic-js/pull/458) ([@Ethella](https://github.com/Ethella)) - -#### ๐Ÿ› Bug Fix - -- Update LICENSE [#459](https://github.com/magiclabs/magic-js/pull/459) ([@srinjoyc](https://github.com/srinjoyc)) - -#### Authors: 2 - -- Jerry Liu ([@Ethella](https://github.com/Ethella)) -- Srinjoy ([@srinjoyc](https://github.com/srinjoyc)) - ---- - -# v7.1.0 (Fri Jan 06 2023) - -#### ๐Ÿš€ Enhancement - -- Bare React Native / Expo React Native Package Split [#412](https://github.com/magiclabs/magic-js/pull/412) ([@Ariflo](https://github.com/Ariflo)) - -#### ๐Ÿ› Bug Fix - -- Maintains backwards compatibility ([@Ariflo](https://github.com/Ariflo)) -- Updates @magic-ext/oauth compatibility settings ([@Ariflo](https://github.com/Ariflo)) - -#### Authors: 1 - -- Arian Flores ([@Ariflo](https://github.com/Ariflo)) - ---- - -# v6.0.0 (Thu Jan 05 2023) - -#### ๐Ÿ› Bug Fix - -- Fix ESLint Issues [#419](https://github.com/magiclabs/magic-js/pull/419) ([@Ariflo](https://github.com/Ariflo)) -- Cast json to string for oauth ([@Ariflo](https://github.com/Ariflo)) - -#### Authors: 1 - -- Arian Flores ([@Ariflo](https://github.com/Ariflo)) - ---- - -# v5.0.0 (Tue Dec 20 2022) - -#### ๐Ÿ› Bug Fix - -- Merge branch 'master' into mushfichowdhury-sc-61149-implement-event-emitting-in-magic-sdk-based ([@mushfichowdhury-magic](https://github.com/mushfichowdhury-magic)) - -#### ๐Ÿ“ Documentation - -- Update CHANGELOG.md \[skip ci\] [#391](https://github.com/magiclabs/magic-js/pull/391) ([@Ariflo](https://github.com/Ariflo)) - -#### Authors: 2 - -- Arian Flores ([@Ariflo](https://github.com/Ariflo)) -- Mushfi Chowdhury ([@mushfichowdhury-magic](https://github.com/mushfichowdhury-magic)) - ---- - -# v4.0.0 (Tues Nov 15 2022) - -#### โž• Version Bump - -- `@magic-ext/oauth@4.0.0` - - Version bump, no major updates - -๐Ÿ  Internal - -- Internal documentation updates (README.md) [#386](https://github.com/magiclabs/magic-js/pull/386) ([@Ariflo](https://github.com/ariflo)) - -#### Authors: 1 - -- Arian Flores ([@Ariflo](https://github.com/ariflo)) - ---- - -# v2.1.0 (Mon Mar 07 2022) - -#### ๐Ÿ› Bug Fix - -- Update READMEs with outdated context/hyperlinks ([@smithki](https://github.com/smithki)) - -#### ๐Ÿ  Internal - -- Internal documentation updates (`BUILD_SYSTEM.md`) [#283](https://github.com/magiclabs/magic-js/pull/283) ([@smithki](https://github.com/smithki)) - -#### Authors: 1 - -- Ian K Smith ([@smithki](https://github.com/smithki)) - ---- - -# v2.0.1 (Tue Jan 25 2022) - -#### ๐Ÿ› Bug Fix - -- Fix CDN build targets [#270](https://github.com/magiclabs/magic-js/pull/270) ([@smithki](https://github.com/smithki)) -- Fix CDN issues related to ESBuild ([@smithki](https://github.com/smithki)) - -#### Authors: 1 - -- Ian K Smith ([@smithki](https://github.com/smithki)) - ---- - -# v2.0.0 (Tue Jan 25 2022) - -#### ๐Ÿ’ฅ Breaking Change - -- Switch from `microbundle` to `esbuild` [#220](https://github.com/magiclabs/magic-js/pull/220) ([@smithki](https://github.com/smithki)) - -#### ๐Ÿ› Bug Fix - -- Merge with master ([@smithki](https://github.com/smithki)) -- Merge branch 'master' into feat/faster-builds ([@smithki](https://github.com/smithki)) -- Modify CDN default exports ([@smithki](https://github.com/smithki)) -- Remove comments from README files ([@smithki](https://github.com/smithki)) -- Fix build errors related to isolatedModules ([@smithki](https://github.com/smithki)) -- Replace microbundle with ESBuild ([@smithki](https://github.com/smithki)) - -#### Authors: 1 - -- Ian K Smith ([@smithki](https://github.com/smithki)) - ---- - -# v0.11.2 (Wed Nov 10 2021) - -#### ๐Ÿ› Bug Fix - -- move crypto-js to devDependencies to fix bundling error [#242](https://github.com/magiclabs/magic-js/pull/242) ([@hcote](https://github.com/hcote)) - -#### Authors: 1 - -- Hunter Cote ([@hcote](https://github.com/hcote)) - ---- - -# v0.10.4 (Thu Oct 21 2021) - -#### ๐Ÿ› Bug Fix - -- Revert to `.js` extension for ES module builds targeting webpack/CRA [#232](https://github.com/magiclabs/magic-js/pull/232) ([@smithki](https://github.com/smithki)) - -#### Authors: 1 - -- Ian K Smith ([@smithki](https://github.com/smithki)) - ---- - -# v0.10.3 (Wed Oct 20 2021) - -#### โš ๏ธ Pushed to `master` - -- Merge branch 'master' of github.com:magiclabs/magic-js ([@smithki](https://github.com/smithki)) -- Force re-publish ([@smithki](https://github.com/smithki)) - -#### Authors: 1 - -- Ian K Smith ([@smithki](https://github.com/smithki)) - ---- - -# v0.10.2 (Wed Oct 20 2021) - -#### ๐Ÿ› Bug Fix - -- Use '.mjs' extension for ESM build files [#230](https://github.com/magiclabs/magic-js/pull/230) ([@smithki](https://github.com/smithki)) - -#### Authors: 1 - -- Ian K Smith ([@smithki](https://github.com/smithki)) - ---- - -# v0.9.1 (Thu Sep 23 2021) - -#### ๐Ÿ› Bug Fix - -- Port `@magic-ext/oauth`, `@magic-ext/react-native-oauth`, `@magic-ext/webauthn` extensions to Magic SDK monorepo [#218](https://github.com/magiclabs/magic-js/pull/218) ([@smithki](https://github.com/smithki)) - -#### Authors: 1 - -- Ian K Smith ([@smithki](https://github.com/smithki)) - ---- - diff --git a/packages/@magic-ext/oauth/LICENSE b/packages/@magic-ext/oauth/LICENSE deleted file mode 100644 index d9a10c0d8..000000000 --- a/packages/@magic-ext/oauth/LICENSE +++ /dev/null @@ -1,176 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/packages/@magic-ext/oauth/README.md b/packages/@magic-ext/oauth/README.md deleted file mode 100644 index 0d4ab42b6..000000000 --- a/packages/@magic-ext/oauth/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# ๐Ÿ”’ Magic OAuth Extension for Web Browsers - -> We suggest use OAUTH2 `@magic-ext/oauth2` package for the best performance - -[![](https://circleci.com/gh/magiclabs/magic-js.svg?style=shield)](https://circleci.com/gh/magiclabs/magic-js) - -> With the Magic JavaScript SDK OAuth extension, you can plug into your favorite social login providers with one, easy-to-use API. - -

- License ยท - Changelog ยท - Contributing Guide -

- -## ๐Ÿ“– Documentation - -See the [developer documentation](https://magic.link/docs/social-login) to learn how to get started with OAuth in Magic SDK. - -## ๐Ÿ”— Installation - -Integrating your app with OAuth will require our client-side NPM package and OAuth extension: - -```bash -# Via NPM: -npm install --save magic-sdk @magic-ext/oauth - -# Via Yarn: -yarn add magic-sdk @magic-ext/oauth -``` - -Alternatively, you can load via CDN with by adding a script tag to your appโ€™s ``: - -```html - - -``` - -## โšก๏ธ Quick Start - -Sign up or log in to the [developer dashboard](https://dashboard.magic.link) to receive API keys that will allow your application to interact with Magic's authentication APIs. - -Then, you can start authenticating users with _just two method calls!_ - -From your login page: - -```ts -import { Magic } from 'magic-sdk'; -import { OAuthExtension } from '@magic-ext/oauth'; - -const magic = new Magic('YOUR_API_KEY', { - extensions: [new OAuthExtension()] -}); - -await magic.oauth.loginWithRedirect({ - provider: 'google' | 'facebook' | 'github' | ... -}); -``` - -From your OAuth callback page: - -```ts -import { Magic } from 'magic-sdk'; -import { OAuthExtension } from '@magic-ext/oauth'; - -const magic = new Magic('YOUR_API_KEY', { - extensions: [new OAuthExtension()] -}); - -const res = await magic.oauth.getRedirectResult(); - -// Then you can access a user's Magic DID token, OAuth access token, -// OpenID Connect profile information, and more! -res.magic.idToken; -res.oauth.accessToken; -res.oauth.userInfo; -``` diff --git a/packages/@magic-ext/oauth/eslint.config.mjs b/packages/@magic-ext/oauth/eslint.config.mjs deleted file mode 100644 index a94768e85..000000000 --- a/packages/@magic-ext/oauth/eslint.config.mjs +++ /dev/null @@ -1,21 +0,0 @@ -import path from 'node:path'; -import { fileURLToPath } from 'node:url'; -import rootEslintConfig from '../../../eslint.config.mjs'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); - -export default [ - ...rootEslintConfig, - { - ignores: ['node_modules', 'coverage', 'dist', 'eslint.config.mjs', 'jest.config.ts'], - }, - { - languageOptions: { - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, - }, - }, -]; diff --git a/packages/@magic-ext/oauth/package.json b/packages/@magic-ext/oauth/package.json deleted file mode 100644 index 01dc3dcfd..000000000 --- a/packages/@magic-ext/oauth/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "@magic-ext/oauth", - "version": "23.4.2", - "description": "Magic SDK OAuth Extension for Web environments.", - "author": "Magic (https://magic.link/)", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/magiclabs/magic-js" - }, - "files": [ - "dist" - ], - "target": "browser", - "cdnGlobalName": "MagicOAuthExtension", - "main": "./dist/cjs/index.js", - "module": "./dist/es/index.js", - "types": "./dist/types/index.d.ts", - "jsdelivr": "./dist/extension.js", - "exports": { - "import": "./dist/es/index.mjs", - "types": "./dist/types/index.d.ts", - "require": "./dist/cjs/index.js" - }, - "externals": { - "include": [ - "@magic-sdk/commons", - "@magic-sdk/provider" - ] - }, - "dependencies": { - "crypto-js": "^4.2.0" - }, - "devDependencies": { - "@magic-sdk/commons": "^25.4.2", - "@types/crypto-js": "~4.2.0" - } -} diff --git a/packages/@magic-ext/oauth/src/crypto.ts b/packages/@magic-ext/oauth/src/crypto.ts deleted file mode 100644 index 9135873f8..000000000 --- a/packages/@magic-ext/oauth/src/crypto.ts +++ /dev/null @@ -1,77 +0,0 @@ -import Crypto from 'crypto-js'; - -const CHARSET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~'; -const HAS_CRYPTO = typeof window !== 'undefined' && !!(window.crypto as any); -const HAS_SUBTLE_CRYPTO = HAS_CRYPTO && !!(window.crypto.subtle as any); - -/** - * Stringifies `bytes` using the OAuth 2.0 `code_verifier` character set. - */ -function bytesToVerifierString(bytes: Uint8Array) { - return Array.from(bytes) - .map((value: number) => CHARSET[value % CHARSET.length]) - .join(''); -} - -/** - * Stringifies argument (as CryptoJS `WordArray` or EcmaScript `ArrayBuffer`) - * and encodes to URL-safe Base64. - */ -function base64URLEncodeFromByteArray(arg: Crypto.lib.WordArray | ArrayBuffer): string { - const makeURLSafe = (base64: string) => { - return base64.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); - }; - - if (arg instanceof ArrayBuffer) { - const bytes = new Uint8Array(arg); - const utf8Binary = Array.from(bytes) - .map(value => String.fromCharCode(value)) - .join(''); - - const base64 = btoa(utf8Binary); - return makeURLSafe(base64); - } - - return makeURLSafe(Crypto.enc.Base64.stringify(arg)); -} - -/** - * Produces a SHA-256 hash of the given `message`. This function first attempts - * to use the browser's built-in `SubtleCrypto` API, falling back to - * CryptoJS if required. - */ -async function sha256(message: string) { - if (HAS_SUBTLE_CRYPTO) { - const bytes = new TextEncoder().encode(message); - return crypto.subtle.digest('SHA-256', bytes).then(base64URLEncodeFromByteArray); - } - - return base64URLEncodeFromByteArray(Crypto.SHA256(message)); -} - -/** - * Creates a cryptographically random string using the browser's built-in - * `Crypto` API, falling back to `Math.random` if required. - */ -function createRandomString(size: number) { - const bytes = new Uint8Array(size); - - if (HAS_CRYPTO) { - window.crypto.getRandomValues(bytes); - } else { - for (let i = 0; i < size; i += 1) bytes[i] = Math.floor(Math.random() * Math.floor(255)); - } - - return bytesToVerifierString(bytes); -} - -/** - * Creates OAuth 2.0-compatible `code_verifier`, `code_challenge`, and `state` - * parameters. - */ -export async function createCryptoChallenge() { - const state = createRandomString(128); - const verifier = createRandomString(128); - const challenge = await sha256(verifier); - return { verifier, challenge, state }; -} diff --git a/packages/@magic-ext/oauth/src/index.cdn.ts b/packages/@magic-ext/oauth/src/index.cdn.ts deleted file mode 100644 index 8a2d2b3f0..000000000 --- a/packages/@magic-ext/oauth/src/index.cdn.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { OAuthExtension } from './index'; -import * as types from './types'; - -Object.assign(OAuthExtension, { - ...types, -}); - -export default OAuthExtension; diff --git a/packages/@magic-ext/oauth/src/index.ts b/packages/@magic-ext/oauth/src/index.ts deleted file mode 100644 index 84398f0c8..000000000 --- a/packages/@magic-ext/oauth/src/index.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { Extension } from '@magic-sdk/commons'; -import { - OAuthErrorData, - OAuthPayloadMethods, - OAuthRedirectError, - OAuthRedirectResult, - OAuthRedirectConfiguration, -} from './types'; -import { createCryptoChallenge } from './crypto'; - -export class OAuthExtension extends Extension.Internal<'oauth'> { - name = 'oauth' as const; - config = {}; - compat = { - 'magic-sdk': '>=2.4.6', - '@magic-sdk/react-native': false, - '@magic-sdk/react-native-bare': false, - '@magic-sdk/react-native-expo': false, - }; - - public loginWithRedirect(configuration: OAuthRedirectConfiguration) { - return this.utils.createPromiEvent(async resolve => { - const { provider, query } = await createURI.call(this, configuration); - - // @ts-ignore - this.sdk.endpoint is marked protected but we need to access it. - window.location.href = new URL(`/v1/oauth2/${provider}/start?${query}`, this.sdk.endpoint).href; - - resolve(); - }); - } - - public getRedirectResult(lifespan?: number) { - const queryString = window.location.search; - - // Remove the query from the redirect callback as a precaution to prevent - // malicious parties from parsing it before we have a chance to use it. - const urlWithoutQuery = window.location.origin + window.location.pathname; - window.history.replaceState(null, '', urlWithoutQuery); - - return getResult.call(this, queryString, lifespan); - } -} - -const OAUTH_REDIRECT_METADATA_KEY = 'oauth_redirect_metadata'; - -async function createURI(this: OAuthExtension, configuration: OAuthRedirectConfiguration) { - // Bust any old, in-progress OAuth flows. - await this.utils.storage.removeItem(OAUTH_REDIRECT_METADATA_KEY); - - // Unpack configuration, generate crypto values, and persist to storage. - const { provider, redirectURI, scope, loginHint } = configuration; - const { verifier, challenge, state } = await createCryptoChallenge(); - - /* Stringify for RN Async storage */ - const storedData = JSON.stringify({ - verifier, - state, - }); - - await this.utils.storage.setItem(OAUTH_REDIRECT_METADATA_KEY, storedData); - - // Formulate the initial redirect query to Magic's OAuth hub. - // Required fields: - // - `magic_api_key` - // - `magic_challenge` - // - `state` - // - `redirect_uri` - // - `platform` - - const query = [ - `magic_api_key=${encodeURIComponent(this.sdk.apiKey)}`, - `magic_challenge=${encodeURIComponent(challenge)}`, - `state=${encodeURIComponent(state)}`, - `platform=${encodeURIComponent('web')}`, - scope && `scope=${encodeURIComponent(scope.join(' '))}`, - redirectURI && `redirect_uri=${encodeURIComponent(redirectURI)}`, - loginHint && `login_hint=${encodeURIComponent(loginHint)}`, - ].reduce((prev, next) => (next ? `${prev}&${next}` : prev)); - - return { - query, - provider, - redirectURI, - }; -} - -function getResult(this: OAuthExtension, queryString: string, lifespan?: number) { - return this.utils.createPromiEvent(async (resolve, reject) => { - const json: string = (await this.utils.storage.getItem(OAUTH_REDIRECT_METADATA_KEY)) as string; - - const { verifier, state } = JSON.parse(json); - - // Remove the save OAuth state from storage, it stays in memory now... - this.utils.storage.removeItem(OAUTH_REDIRECT_METADATA_KEY); - - const parseRedirectResult = this.utils.createJsonRpcRequestPayload(OAuthPayloadMethods.ParseRedirectResult, [ - queryString, - verifier, - state, - lifespan, - ]); - - // Parse the result, which may contain an OAuth-formatted error. - const resultOrError = await this.request(parseRedirectResult); - const maybeResult = resultOrError as OAuthRedirectResult; - const maybeError = resultOrError as OAuthRedirectError; - - if (maybeError.error) { - reject( - this.createError(maybeError.error, maybeError.error_description ?? 'An error occurred.', { - errorURI: maybeError.error_uri, - provider: maybeError.provider, - }), - ); - } - - resolve(maybeResult); - }); -} - -export * from './types'; diff --git a/packages/@magic-ext/oauth/src/types.ts b/packages/@magic-ext/oauth/src/types.ts deleted file mode 100644 index 490dbe138..000000000 --- a/packages/@magic-ext/oauth/src/types.ts +++ /dev/null @@ -1,109 +0,0 @@ -import { MagicUserMetadata } from '@magic-sdk/types'; - -export enum OAuthPayloadMethods { - ParseRedirectResult = 'magic_oauth_parse_redirect_result', -} - -export type OAuthProvider = - | 'google' - | 'facebook' - | 'apple' - | 'github' - | 'bitbucket' - | 'gitlab' - | 'linkedin' - | 'twitter' - | 'discord' - | 'twitch' - | 'microsoft'; - -export interface OAuthErrorData { - provider: OAuthProvider; - errorURI?: string; -} - -export interface OpenIDConnectProfile { - name?: string; - familyName?: string; - givenName?: string; - middleName?: string; - nickname?: string; - preferredUsername?: string; - profile?: string; - picture?: string; - website?: string; - gender?: string; - birthdate?: string; - zoneinfo?: string; - locale?: string; - updatedAt?: number; -} - -export interface OpenIDConnectEmail { - email?: string; - emailVerified?: boolean; -} - -export interface OpenIDConnectPhone { - phoneNumber?: string; - phoneNumberVerified?: boolean; -} - -export interface OpenIDConnectAddress { - address?: { - formatted?: string; - streetAddress?: string; - locality?: string; - region?: string; - postalCode?: string; - country?: string; - }; -} - -export type OpenIDConnectUserInfo = OpenIDConnectProfile & - OpenIDConnectEmail & - OpenIDConnectPhone & - OpenIDConnectAddress & { sub?: string; sources?: Record } & Record; - -export interface OAuthRedirectResult { - oauth: { - provider: OAuthProvider; - scope: string[]; - accessToken: string; - userHandle: string; - userInfo: OpenIDConnectUserInfo; - }; - - magic: { - idToken: string; - userMetadata: MagicUserMetadata; - }; -} - -export interface OAuthRedirectError { - provider: OAuthProvider; - error: string; - error_description?: string; - error_uri?: string; -} - -export interface OAuthRedirectConfiguration { - provider: OAuthProvider; - redirectURI: string; - scope?: string[]; - loginHint?: string; -} - -export enum OAuthErrorCode { - InvalidRequest = 'invalid_request', - InvalidClient = 'invalid_client', - InvalidScope = 'invalid_scope', - InvalidGrant = 'invalid_grant', - UnauthorizedClient = 'unauthorized_client', - UnsupportedResponseType = 'unsupported_response_type', - UnsupportedGrantType = 'unsupported_grant_type', - UnsupportedTokenType = 'unsupported_token_type', - AccessDenied = 'access_denied', - ServerError = 'server_error', - TemporarilyUnavailable = 'temporarily_unavailable', -} diff --git a/packages/@magic-ext/oauth/tsconfig.json b/packages/@magic-ext/oauth/tsconfig.json deleted file mode 100644 index c268bce54..000000000 --- a/packages/@magic-ext/oauth/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../../tsconfig.settings.json", -} - From b64bae3e15d115af901ecb3644e643bcdc63cc1d Mon Sep 17 00:00:00 2001 From: ethella Date: Wed, 3 Sep 2025 15:19:38 -0700 Subject: [PATCH 2/6] bump yarn.lock --- yarn.lock | 115 +++++++++++++++++++++++++++--------------------------- 1 file changed, 57 insertions(+), 58 deletions(-) diff --git a/yarn.lock b/yarn.lock index dffa188b7..10becfd70 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3035,7 +3035,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/algorand@workspace:packages/@magic-ext/algorand" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3044,8 +3044,8 @@ __metadata: resolution: "@magic-ext/aptos@workspace:packages/@magic-ext/aptos" dependencies: "@aptos-labs/wallet-adapter-core": ^2.2.0 - "@magic-sdk/commons": ^25.4.2 - "@magic-sdk/provider": ^29.4.2 + "@magic-sdk/commons": ^26.0.0 + "@magic-sdk/provider": ^30.0.0 aptos: ^1.8.5 peerDependencies: "@aptos-labs/wallet-adapter-core": ^2.2.0 @@ -3057,7 +3057,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/avalanche@workspace:packages/@magic-ext/avalanche" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3065,7 +3065,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/bitcoin@workspace:packages/@magic-ext/bitcoin" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3073,7 +3073,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/conflux@workspace:packages/@magic-ext/conflux" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3081,7 +3081,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/cosmos@workspace:packages/@magic-ext/cosmos" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3089,7 +3089,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/ed25519@workspace:packages/@magic-ext/ed25519" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3097,7 +3097,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/farcaster@workspace:packages/@magic-ext/farcaster" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3105,7 +3105,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/flow@workspace:packages/@magic-ext/flow" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 "@onflow/fcl": ^1.4.1 "@onflow/types": ^1.1.0 peerDependencies: @@ -3118,8 +3118,8 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/gdkms@workspace:packages/@magic-ext/gdkms" dependencies: - "@magic-sdk/commons": ^25.4.2 - "@magic-sdk/types": ^24.21.0 + "@magic-sdk/commons": ^26.0.0 + "@magic-sdk/types": ^25.0.0 languageName: unknown linkType: soft @@ -3127,7 +3127,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/harmony@workspace:packages/@magic-ext/harmony" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3145,7 +3145,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/icon@workspace:packages/@magic-ext/icon" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3153,7 +3153,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/kadena@workspace:packages/@magic-ext/kadena" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3161,7 +3161,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/near@workspace:packages/@magic-ext/near" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3169,27 +3169,26 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/oauth2@workspace:packages/@magic-ext/oauth2" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 "@types/crypto-js": 4.2.0 crypto-js: ^4.2.0 languageName: unknown linkType: soft -"@magic-ext/oauth@^23.4.2, @magic-ext/oauth@workspace:packages/@magic-ext/oauth": - version: 0.0.0-use.local - resolution: "@magic-ext/oauth@workspace:packages/@magic-ext/oauth" +"@magic-ext/oauth@npm:^24.0.0": + version: 24.0.0 + resolution: "@magic-ext/oauth@npm:24.0.0" dependencies: - "@magic-sdk/commons": ^25.4.2 - "@types/crypto-js": ~4.2.0 crypto-js: ^4.2.0 - languageName: unknown - linkType: soft + checksum: e7092f1f2e7142820d12e76dd7b1117ef391ca33741c8983766492b8ccda7d3c46acb318adde55ae92872639e9f396f79a4af1dbc9fba47486f87c9cd9def4b8 + languageName: node + linkType: hard "@magic-ext/oidc@workspace:packages/@magic-ext/oidc": version: 0.0.0-use.local resolution: "@magic-ext/oidc@workspace:packages/@magic-ext/oidc" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3197,7 +3196,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/polkadot@workspace:packages/@magic-ext/polkadot" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3205,8 +3204,8 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/react-native-bare-oauth@workspace:packages/@magic-ext/react-native-bare-oauth" dependencies: - "@magic-sdk/react-native-bare": ^30.4.2 - "@magic-sdk/types": ^24.21.0 + "@magic-sdk/react-native-bare": ^31.0.0 + "@magic-sdk/types": ^25.0.0 react-native-inappbrowser-reborn: ^3.7.0 peerDependencies: "@magic-sdk/react-native-bare": ">=13.0.0" @@ -3218,8 +3217,8 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/react-native-expo-oauth@workspace:packages/@magic-ext/react-native-expo-oauth" dependencies: - "@magic-sdk/react-native-expo": ^30.4.2 - "@magic-sdk/types": ^24.18.2 + "@magic-sdk/react-native-expo": ^31.0.0 + "@magic-sdk/types": ^25.0.0 "@react-native-async-storage/async-storage": ^2.1.2 "@types/crypto-js": ~4.2.0 expo-web-browser: 14.0.2 @@ -3234,7 +3233,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/solana@workspace:packages/@magic-ext/solana" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 "@solana/web3.js": ^1.87.2 peerDependencies: "@solana/web3.js": ^1.87.2 @@ -3245,7 +3244,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/sui@workspace:packages/@magic-ext/sui" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3253,7 +3252,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/taquito@workspace:packages/@magic-ext/taquito" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3261,7 +3260,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/terra@workspace:packages/@magic-ext/terra" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3269,7 +3268,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/tezos@workspace:packages/@magic-ext/tezos" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3277,7 +3276,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/web3modal-ethers5@workspace:packages/@magic-ext/web3modal-ethers5" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 "@magic-sdk/types": 24.0.6-canary.742.10067162636.0 "@web3modal/ethers5": 5.0.3 ethers: 5.7.2 @@ -3288,7 +3287,7 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/webauthn@workspace:packages/@magic-ext/webauthn" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft @@ -3296,16 +3295,16 @@ __metadata: version: 0.0.0-use.local resolution: "@magic-ext/zilliqa@workspace:packages/@magic-ext/zilliqa" dependencies: - "@magic-sdk/commons": ^25.4.2 + "@magic-sdk/commons": ^26.0.0 languageName: unknown linkType: soft -"@magic-sdk/commons@^25.4.2, @magic-sdk/commons@workspace:packages/@magic-sdk/commons": +"@magic-sdk/commons@^26.0.0, @magic-sdk/commons@workspace:packages/@magic-sdk/commons": version: 0.0.0-use.local resolution: "@magic-sdk/commons@workspace:packages/@magic-sdk/commons" dependencies: - "@magic-sdk/provider": ^29.4.2 - "@magic-sdk/types": ^24.21.0 + "@magic-sdk/provider": ^30.0.0 + "@magic-sdk/types": ^25.0.0 peerDependencies: "@magic-sdk/provider": ">=18.6.0" "@magic-sdk/types": ">=15.8.0" @@ -3327,17 +3326,17 @@ __metadata: resolution: "@magic-sdk/pnp@workspace:packages/@magic-sdk/pnp" dependencies: "@babel/plugin-proposal-optional-chaining": ^7.9.0 - "@magic-ext/oauth": ^23.4.2 - magic-sdk: ^29.4.2 + "@magic-ext/oauth": ^24.0.0 + magic-sdk: ^30.0.0 languageName: unknown linkType: soft -"@magic-sdk/provider@^29.4.2, @magic-sdk/provider@workspace:packages/@magic-sdk/provider": +"@magic-sdk/provider@^30.0.0, @magic-sdk/provider@workspace:packages/@magic-sdk/provider": version: 0.0.0-use.local resolution: "@magic-sdk/provider@workspace:packages/@magic-sdk/provider" dependencies: "@babel/plugin-transform-modules-commonjs": ^7.9.6 - "@magic-sdk/types": ^24.21.0 + "@magic-sdk/types": ^25.0.0 eventemitter3: ^4.0.4 localforage: ^1.7.4 tslib: ^2.3.1 @@ -3346,14 +3345,14 @@ __metadata: languageName: unknown linkType: soft -"@magic-sdk/react-native-bare@^30.4.2, @magic-sdk/react-native-bare@workspace:packages/@magic-sdk/react-native-bare": +"@magic-sdk/react-native-bare@^31.0.0, @magic-sdk/react-native-bare@workspace:packages/@magic-sdk/react-native-bare": version: 0.0.0-use.local resolution: "@magic-sdk/react-native-bare@workspace:packages/@magic-sdk/react-native-bare" dependencies: "@aveq-research/localforage-asyncstorage-driver": ^3.0.1 - "@magic-sdk/commons": ^25.4.2 - "@magic-sdk/provider": ^29.4.2 - "@magic-sdk/types": ^24.21.0 + "@magic-sdk/commons": ^26.0.0 + "@magic-sdk/provider": ^30.0.0 + "@magic-sdk/types": ^25.0.0 "@react-native-async-storage/async-storage": ^2.1.2 "@react-native-community/netinfo": ">11.0.0" "@react-native/babel-preset": ^0.79.0 @@ -3384,13 +3383,13 @@ __metadata: languageName: unknown linkType: soft -"@magic-sdk/react-native-expo@^30.4.2, @magic-sdk/react-native-expo@workspace:packages/@magic-sdk/react-native-expo": +"@magic-sdk/react-native-expo@^31.0.0, @magic-sdk/react-native-expo@workspace:packages/@magic-sdk/react-native-expo": version: 0.0.0-use.local resolution: "@magic-sdk/react-native-expo@workspace:packages/@magic-sdk/react-native-expo" dependencies: - "@magic-sdk/commons": ^25.4.2 - "@magic-sdk/provider": ^29.4.2 - "@magic-sdk/types": ^24.21.0 + "@magic-sdk/commons": ^26.0.0 + "@magic-sdk/provider": ^30.0.0 + "@magic-sdk/types": ^25.0.0 "@react-native-async-storage/async-storage": ^2.1.2 "@react-native-community/netinfo": ">11.0.0" "@react-native/assets-registry": ^0.78.2 @@ -3424,7 +3423,7 @@ __metadata: languageName: unknown linkType: soft -"@magic-sdk/types@^24.18.2, @magic-sdk/types@^24.21.0, @magic-sdk/types@workspace:packages/@magic-sdk/types": +"@magic-sdk/types@^25.0.0, @magic-sdk/types@workspace:packages/@magic-sdk/types": version: 0.0.0-use.local resolution: "@magic-sdk/types@workspace:packages/@magic-sdk/types" languageName: unknown @@ -14374,13 +14373,13 @@ __metadata: languageName: unknown linkType: soft -"magic-sdk@^29.4.2, magic-sdk@workspace:packages/magic-sdk": +"magic-sdk@^30.0.0, magic-sdk@workspace:packages/magic-sdk": version: 0.0.0-use.local resolution: "magic-sdk@workspace:packages/magic-sdk" dependencies: - "@magic-sdk/commons": ^25.4.2 - "@magic-sdk/provider": ^29.4.2 - "@magic-sdk/types": ^24.21.0 + "@magic-sdk/commons": ^26.0.0 + "@magic-sdk/provider": ^30.0.0 + "@magic-sdk/types": ^25.0.0 localforage: ^1.7.4 languageName: unknown linkType: soft From 4b14bde73a91e068918d795ea8d6cf8d2a47e71e Mon Sep 17 00:00:00 2001 From: ethella Date: Wed, 3 Sep 2025 15:51:39 -0700 Subject: [PATCH 3/6] update dependencies in pnp --- packages/@magic-ext/oauth2/package.json | 2 +- packages/@magic-ext/oauth2/src/index.ts | 4 ++-- packages/@magic-sdk/pnp/src/context/callback.ts | 2 +- packages/@magic-sdk/pnp/src/context/login.ts | 2 +- packages/@magic-sdk/pnp/src/types.ts | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/@magic-ext/oauth2/package.json b/packages/@magic-ext/oauth2/package.json index d6f6a4e77..0835a5fe3 100644 --- a/packages/@magic-ext/oauth2/package.json +++ b/packages/@magic-ext/oauth2/package.json @@ -12,7 +12,7 @@ "dist" ], "target": "browser", - "cdnGlobalName": "MagicOAuth2Extension", + "cdnGlobalName": "MagicOAuthExtension", "main": "./dist/cjs/index.js", "module": "./dist/es/index.js", "types": "./dist/types/index.d.ts", diff --git a/packages/@magic-ext/oauth2/src/index.ts b/packages/@magic-ext/oauth2/src/index.ts index 604b3a269..841c5c27f 100644 --- a/packages/@magic-ext/oauth2/src/index.ts +++ b/packages/@magic-ext/oauth2/src/index.ts @@ -74,8 +74,8 @@ export class OAuthExtension extends Extension.Internal<'oauth2'> { }); } - public getRedirectResult(configuration: OAuthVerificationConfiguration) { - const queryString = configuration.optionalQueryString || window.location.search; + public getRedirectResult(configuration: OAuthVerificationConfiguration = {}) { + const queryString = configuration?.optionalQueryString || window.location.search; // Remove the query from the redirect callback as a precaution to prevent // malicious parties from parsing it before we have a chance to use it. diff --git a/packages/@magic-sdk/pnp/src/context/callback.ts b/packages/@magic-sdk/pnp/src/context/callback.ts index 2d5d65b79..e60500814 100644 --- a/packages/@magic-sdk/pnp/src/context/callback.ts +++ b/packages/@magic-sdk/pnp/src/context/callback.ts @@ -17,7 +17,7 @@ export async function callback(): Promise { } async function handleOAuthCallback() { - const res = await magic.oauth.getRedirectResult(); + const res = await magic.oauth2.getRedirectResult(); dispatchReadyEvent(magic, { idToken: res.magic.idToken, userMetadata: res.magic.userMetadata, diff --git a/packages/@magic-sdk/pnp/src/context/login.ts b/packages/@magic-sdk/pnp/src/context/login.ts index 385b53ce2..3d64e6af4 100644 --- a/packages/@magic-sdk/pnp/src/context/login.ts +++ b/packages/@magic-sdk/pnp/src/context/login.ts @@ -16,7 +16,7 @@ export async function login(): Promise { async function handleOAuthLogin(provider: any) { await magic.pnp.saveLastUsedProvider(provider); - await magic.oauth.loginWithRedirect({ provider, redirectURI }); + await magic.oauth2.loginWithRedirect({ provider, redirectURI }); } async function handleEmailLinkLogin(email: any) { diff --git a/packages/@magic-sdk/pnp/src/types.ts b/packages/@magic-sdk/pnp/src/types.ts index 410c2c587..2172baca1 100644 --- a/packages/@magic-sdk/pnp/src/types.ts +++ b/packages/@magic-sdk/pnp/src/types.ts @@ -1,5 +1,5 @@ import type { Magic } from 'magic-sdk/dist/types/index'; -import type OAuthExtension from '@magic-ext/oauth/dist/types/index.cdn'; +import type OAuthExtension from '@magic-ext/oauth/dist/types/index'; import type CDNMagic from 'magic-sdk/dist/types/index.cdn'; declare global { From 4372fba9b6d085198ba492bd14e0243048ea1a36 Mon Sep 17 00:00:00 2001 From: ethella Date: Wed, 3 Sep 2025 15:57:44 -0700 Subject: [PATCH 4/6] fix index.cdn --- packages/@magic-sdk/pnp/src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@magic-sdk/pnp/src/types.ts b/packages/@magic-sdk/pnp/src/types.ts index 2172baca1..845342484 100644 --- a/packages/@magic-sdk/pnp/src/types.ts +++ b/packages/@magic-sdk/pnp/src/types.ts @@ -1,5 +1,5 @@ import type { Magic } from 'magic-sdk/dist/types/index'; -import type OAuthExtension from '@magic-ext/oauth/dist/types/index'; +import type OAuthExtension from '@magic-ext/oauth2/dist/types/index.cdn'; import type CDNMagic from 'magic-sdk/dist/types/index.cdn'; declare global { From 17750980961e944141c3bc8df00ff6eda1dae455 Mon Sep 17 00:00:00 2001 From: ethella Date: Wed, 3 Sep 2025 16:13:30 -0700 Subject: [PATCH 5/6] migrate to oauth2 --- packages/@magic-sdk/pnp/package.json | 2 +- yarn.lock | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/@magic-sdk/pnp/package.json b/packages/@magic-sdk/pnp/package.json index 8030842dc..35d81d75b 100644 --- a/packages/@magic-sdk/pnp/package.json +++ b/packages/@magic-sdk/pnp/package.json @@ -17,7 +17,7 @@ "jsdelivr": "./dist/magic-pnp.js", "devDependencies": { "@babel/plugin-proposal-optional-chaining": "^7.9.0", - "@magic-ext/oauth": "^24.0.0", + "@magic-ext/oauth2": "^12.0.0", "magic-sdk": "^30.0.0" }, "gitHead": "1ef062ea699d48d5e9a9375a93b7c147632b05ca" diff --git a/yarn.lock b/yarn.lock index 10becfd70..19be357bc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3165,7 +3165,7 @@ __metadata: languageName: unknown linkType: soft -"@magic-ext/oauth2@workspace:packages/@magic-ext/oauth2": +"@magic-ext/oauth2@^12.0.0, @magic-ext/oauth2@workspace:packages/@magic-ext/oauth2": version: 0.0.0-use.local resolution: "@magic-ext/oauth2@workspace:packages/@magic-ext/oauth2" dependencies: @@ -3175,15 +3175,6 @@ __metadata: languageName: unknown linkType: soft -"@magic-ext/oauth@npm:^24.0.0": - version: 24.0.0 - resolution: "@magic-ext/oauth@npm:24.0.0" - dependencies: - crypto-js: ^4.2.0 - checksum: e7092f1f2e7142820d12e76dd7b1117ef391ca33741c8983766492b8ccda7d3c46acb318adde55ae92872639e9f396f79a4af1dbc9fba47486f87c9cd9def4b8 - languageName: node - linkType: hard - "@magic-ext/oidc@workspace:packages/@magic-ext/oidc": version: 0.0.0-use.local resolution: "@magic-ext/oidc@workspace:packages/@magic-ext/oidc" @@ -3326,7 +3317,7 @@ __metadata: resolution: "@magic-sdk/pnp@workspace:packages/@magic-sdk/pnp" dependencies: "@babel/plugin-proposal-optional-chaining": ^7.9.0 - "@magic-ext/oauth": ^24.0.0 + "@magic-ext/oauth2": ^12.0.0 magic-sdk: ^30.0.0 languageName: unknown linkType: soft From 2c77210c6bb48c558bb9de50ab9aeea26d70e6e6 Mon Sep 17 00:00:00 2001 From: ethella Date: Thu, 2 Oct 2025 13:23:32 -0700 Subject: [PATCH 6/6] update yarn.lock --- yarn.lock | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/yarn.lock b/yarn.lock index f69a3f68f..1e3fcd794 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3165,7 +3165,7 @@ __metadata: languageName: unknown linkType: soft -"@magic-ext/oauth2@workspace:packages/@magic-ext/oauth2": +"@magic-ext/oauth2@^12.0.0, @magic-ext/oauth2@workspace:packages/@magic-ext/oauth2": version: 0.0.0-use.local resolution: "@magic-ext/oauth2@workspace:packages/@magic-ext/oauth2" dependencies: @@ -3175,15 +3175,6 @@ __metadata: languageName: unknown linkType: soft -"@magic-ext/oauth@npm:^24.0.0": - version: 24.0.0 - resolution: "@magic-ext/oauth@npm:24.0.0" - dependencies: - crypto-js: ^4.2.0 - checksum: e7092f1f2e7142820d12e76dd7b1117ef391ca33741c8983766492b8ccda7d3c46acb318adde55ae92872639e9f396f79a4af1dbc9fba47486f87c9cd9def4b8 - languageName: node - linkType: hard - "@magic-ext/oidc@workspace:packages/@magic-ext/oidc": version: 0.0.0-use.local resolution: "@magic-ext/oidc@workspace:packages/@magic-ext/oidc" @@ -3326,7 +3317,7 @@ __metadata: resolution: "@magic-sdk/pnp@workspace:packages/@magic-sdk/pnp" dependencies: "@babel/plugin-proposal-optional-chaining": ^7.9.0 - "@magic-ext/oauth": ^24.0.0 + "@magic-ext/oauth2": ^12.0.0 magic-sdk: ^30.0.0 languageName: unknown linkType: soft