@better-auth/expo 1.3.8-beta.2 → 1.3.8-beta.4
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/dist/client.cjs +12 -3
- package/dist/client.mjs +11 -1
- package/package.json +4 -5
package/dist/client.cjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const Browser = require('expo-web-browser');
|
|
4
3
|
const Linking = require('expo-linking');
|
|
5
4
|
const reactNative = require('react-native');
|
|
6
5
|
const Constants = require('expo-constants');
|
|
@@ -19,7 +18,6 @@ function _interopNamespaceCompat(e) {
|
|
|
19
18
|
return n;
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
const Browser__namespace = /*#__PURE__*/_interopNamespaceCompat(Browser);
|
|
23
21
|
const Linking__namespace = /*#__PURE__*/_interopNamespaceCompat(Linking);
|
|
24
22
|
const Constants__default = /*#__PURE__*/_interopDefaultCompat(Constants);
|
|
25
23
|
|
|
@@ -178,7 +176,18 @@ const expoClient = (opts) => {
|
|
|
178
176
|
const callbackURL = JSON.parse(context.request.body)?.callbackURL;
|
|
179
177
|
const to = callbackURL;
|
|
180
178
|
const signInURL = context.data?.url;
|
|
181
|
-
|
|
179
|
+
let Browser = void 0;
|
|
180
|
+
try {
|
|
181
|
+
Browser = await import('expo-web-browser');
|
|
182
|
+
} catch (error) {
|
|
183
|
+
throw new Error(
|
|
184
|
+
'"expo-web-browser" is not installed as a dependency!',
|
|
185
|
+
{
|
|
186
|
+
cause: error
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
const result = await Browser.openAuthSessionAsync(signInURL, to);
|
|
182
191
|
if (result.type !== "success") return;
|
|
183
192
|
const url = new URL(result.url);
|
|
184
193
|
const cookie = String(url.searchParams.get("cookie"));
|
package/dist/client.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as Browser from 'expo-web-browser';
|
|
2
1
|
import * as Linking from 'expo-linking';
|
|
3
2
|
import { Platform } from 'react-native';
|
|
4
3
|
import Constants from 'expo-constants';
|
|
@@ -158,6 +157,17 @@ const expoClient = (opts) => {
|
|
|
158
157
|
const callbackURL = JSON.parse(context.request.body)?.callbackURL;
|
|
159
158
|
const to = callbackURL;
|
|
160
159
|
const signInURL = context.data?.url;
|
|
160
|
+
let Browser = void 0;
|
|
161
|
+
try {
|
|
162
|
+
Browser = await import('expo-web-browser');
|
|
163
|
+
} catch (error) {
|
|
164
|
+
throw new Error(
|
|
165
|
+
'"expo-web-browser" is not installed as a dependency!',
|
|
166
|
+
{
|
|
167
|
+
cause: error
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
}
|
|
161
171
|
const result = await Browser.openAuthSessionAsync(signInURL, to);
|
|
162
172
|
if (result.type !== "success") return;
|
|
163
173
|
const url = new URL(result.url);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/expo",
|
|
3
|
-
"version": "1.3.8-beta.
|
|
3
|
+
"version": "1.3.8-beta.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -52,15 +52,14 @@
|
|
|
52
52
|
"expo-secure-store": "~14.0.1",
|
|
53
53
|
"expo-web-browser": "~14.0.2",
|
|
54
54
|
"unbuild": "^3.5.0",
|
|
55
|
-
"better-auth": "1.3.8-beta.
|
|
55
|
+
"better-auth": "1.3.8-beta.4"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"better-auth": "1.3.8-beta.
|
|
58
|
+
"better-auth": "1.3.8-beta.4"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@better-fetch/fetch": "^1.1.18",
|
|
62
|
-
"better-call": "1.0.15"
|
|
63
|
-
"zod": "^4.0.0"
|
|
62
|
+
"better-call": "1.0.15"
|
|
64
63
|
},
|
|
65
64
|
"files": [
|
|
66
65
|
"dist"
|