@dynamic-labs/utils 3.0.0-alpha.53 → 3.0.0-alpha.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/package.json +4 -4
- package/src/services/Oauth2Service/Oauth2Service.d.ts +4 -0
- package/src/services/Oauth2Service/createWindowOauth2Service/createWindowOauth2Service.cjs +6 -3
- package/src/services/Oauth2Service/createWindowOauth2Service/createWindowOauth2Service.js +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
|
|
2
|
+
## [3.0.0-alpha.55](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.54...v3.0.0-alpha.55) (2024-09-02)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### ⚠ BREAKING CHANGES
|
|
6
|
+
|
|
7
|
+
* remove network prop from wallet ([#6716](https://github.com/dynamic-labs/DynamicAuth/issues/6716)) ([b3f90aa](https://github.com/dynamic-labs/DynamicAuth/commit/b3f90aa57cb494f35e3e8b4bc94343d676b2bb4f))
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* override viem chain data with evmNetworks override data ([#6779](https://github.com/dynamic-labs/DynamicAuth/issues/6779)) ([0d836a0](https://github.com/dynamic-labs/DynamicAuth/commit/0d836a0897b7e950e1e91e991f06da338d0cd0db))
|
|
12
|
+
* sdkHasLoaded waits for session validation ([#6769](https://github.com/dynamic-labs/DynamicAuth/issues/6769)) ([72a700b](https://github.com/dynamic-labs/DynamicAuth/commit/72a700b697aad7eca7e8a9b61eddd135aece8da3))
|
|
13
|
+
* send transaction cropping on insufficient funds ([#6776](https://github.com/dynamic-labs/DynamicAuth/issues/6776)) ([995c1f0](https://github.com/dynamic-labs/DynamicAuth/commit/995c1f0b6957112cfa50e4487bdaaa5993c0691d))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [3.0.0-alpha.54](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.53...v3.0.0-alpha.54) (2024-08-29)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* transaction hanging in confirmation modal ([#6740](https://github.com/dynamic-labs/DynamicAuth/issues/6740)) ([f03d286](https://github.com/dynamic-labs/DynamicAuth/commit/f03d286aaf471dbc7a6149acee10512be7b56b18))
|
|
22
|
+
|
|
2
23
|
## [3.0.0-alpha.53](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.52...v3.0.0-alpha.53) (2024-08-29)
|
|
3
24
|
|
|
4
25
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/utils",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.55",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
29
|
+
"@dynamic-labs/sdk-api-core": "0.0.524",
|
|
30
30
|
"tldts": "6.0.16",
|
|
31
|
-
"@dynamic-labs/logger": "3.0.0-alpha.
|
|
32
|
-
"@dynamic-labs/types": "3.0.0-alpha.
|
|
31
|
+
"@dynamic-labs/logger": "3.0.0-alpha.55",
|
|
32
|
+
"@dynamic-labs/types": "3.0.0-alpha.55",
|
|
33
33
|
"buffer": "6.0.3",
|
|
34
34
|
"stream": "0.0.2"
|
|
35
35
|
},
|
|
@@ -11,6 +11,10 @@ export type GetOauthCodeProps = {
|
|
|
11
11
|
}) => Promise<void>;
|
|
12
12
|
state: string;
|
|
13
13
|
oauthLoginUrl: URL;
|
|
14
|
+
/**
|
|
15
|
+
* The preferred strategy to use for the OAuth2 flow.
|
|
16
|
+
*/
|
|
17
|
+
strategy: 'popup' | 'redirect';
|
|
14
18
|
sessionTimeout: number;
|
|
15
19
|
/**
|
|
16
20
|
* Overrides the default redirectUrl coming from the DynamicContextProvider
|
|
@@ -11,11 +11,14 @@ var isMobile = require('../../../isMobile.cjs');
|
|
|
11
11
|
|
|
12
12
|
let authWindowInterval;
|
|
13
13
|
const createWindowOauth2Service = () => ({
|
|
14
|
-
getOauthCode: ({ apiProvider, provider, redirectUrl, setIsProcessing, state, oauthLoginUrl,
|
|
14
|
+
getOauthCode: ({ apiProvider, provider, redirectUrl, setIsProcessing, state, oauthLoginUrl, initWebAuth, strategy, }) => new Promise((resolve, _reject) => {
|
|
15
15
|
/**
|
|
16
16
|
* Use AppleID SDK for Apple provider on mobile
|
|
17
|
+
* It should use the strategy setting, but on ios or safari
|
|
18
|
+
* it should use the appleId always as it is the best experience
|
|
17
19
|
*/
|
|
18
|
-
if (
|
|
20
|
+
if (provider === types.ProviderEnum.Apple &&
|
|
21
|
+
(isMobile.isSafariBrowser() || isMobile.isIOS() || strategy === 'redirect')) {
|
|
19
22
|
initWebAuth({
|
|
20
23
|
redirectUrl: redirectUrl || window.location.href,
|
|
21
24
|
}).then(() => connectWithAppleId.connectWithAppleId({
|
|
@@ -28,7 +31,7 @@ const createWindowOauth2Service = () => ({
|
|
|
28
31
|
/**
|
|
29
32
|
* Use redirect flow on mobile for all providers except Telegram
|
|
30
33
|
*/
|
|
31
|
-
if (
|
|
34
|
+
if (strategy === 'redirect' && provider !== types.ProviderEnum.Telegram) {
|
|
32
35
|
initWebAuth({
|
|
33
36
|
redirectUrl: redirectUrl || window.location.href,
|
|
34
37
|
}).then(() => {
|
|
@@ -3,15 +3,18 @@ import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
|
3
3
|
import { ProviderEnum, SocialOAuthErrorCode } from '@dynamic-labs/types';
|
|
4
4
|
import { logger } from '../../../logger/logger.js';
|
|
5
5
|
import { connectWithAppleId } from '../utils/connectWithAppleId/connectWithAppleId.js';
|
|
6
|
-
import { isSafariBrowser } from '../../../isMobile.js';
|
|
6
|
+
import { isSafariBrowser, isIOS } from '../../../isMobile.js';
|
|
7
7
|
|
|
8
8
|
let authWindowInterval;
|
|
9
9
|
const createWindowOauth2Service = () => ({
|
|
10
|
-
getOauthCode: ({ apiProvider, provider, redirectUrl, setIsProcessing, state, oauthLoginUrl,
|
|
10
|
+
getOauthCode: ({ apiProvider, provider, redirectUrl, setIsProcessing, state, oauthLoginUrl, initWebAuth, strategy, }) => new Promise((resolve, _reject) => {
|
|
11
11
|
/**
|
|
12
12
|
* Use AppleID SDK for Apple provider on mobile
|
|
13
|
+
* It should use the strategy setting, but on ios or safari
|
|
14
|
+
* it should use the appleId always as it is the best experience
|
|
13
15
|
*/
|
|
14
|
-
if (
|
|
16
|
+
if (provider === ProviderEnum.Apple &&
|
|
17
|
+
(isSafariBrowser() || isIOS() || strategy === 'redirect')) {
|
|
15
18
|
initWebAuth({
|
|
16
19
|
redirectUrl: redirectUrl || window.location.href,
|
|
17
20
|
}).then(() => connectWithAppleId({
|
|
@@ -24,7 +27,7 @@ const createWindowOauth2Service = () => ({
|
|
|
24
27
|
/**
|
|
25
28
|
* Use redirect flow on mobile for all providers except Telegram
|
|
26
29
|
*/
|
|
27
|
-
if (
|
|
30
|
+
if (strategy === 'redirect' && provider !== ProviderEnum.Telegram) {
|
|
28
31
|
initWebAuth({
|
|
29
32
|
redirectUrl: redirectUrl || window.location.href,
|
|
30
33
|
}).then(() => {
|