@ankhorage/studio 1.6.0 → 1.8.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../../../src/host/layout/templates/auth/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAEnF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAG5E,UAAU,4BAA6B,SAAQ,mBAAmB;IAChE,QAAQ,CAAC,aAAa,EAAE,0BAA0B,CAAC;CACpD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,4BAA4B,
|
|
1
|
+
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../../../src/host/layout/templates/auth/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAEnF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAG5E,UAAU,4BAA6B,SAAQ,mBAAmB;IAChE,QAAQ,CAAC,aAAa,EAAE,0BAA0B,CAAC;CACpD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,4BAA4B,UAoZvE"}
|
|
@@ -12,6 +12,11 @@ export function getAuthOAuthRuntimeTs(args) {
|
|
|
12
12
|
AuthOAuthCompletionResult,
|
|
13
13
|
AuthOAuthTransportCancellationReason,
|
|
14
14
|
} from '@ankhorage/contracts/auth';
|
|
15
|
+
import {
|
|
16
|
+
resolveExpoOAuthBrowserException,
|
|
17
|
+
resolveExpoOAuthBrowserResult,
|
|
18
|
+
} from '@ankhorage/expo-runtime/oauth-browser';
|
|
19
|
+
import { resolveExpoOAuthBrowserRuntimeReadiness } from '@ankhorage/expo-runtime/oauth-browser-runtime';
|
|
15
20
|
import * as Linking from 'expo-linking';
|
|
16
21
|
import * as WebBrowser from 'expo-web-browser';
|
|
17
22
|
import { Platform } from 'react-native';
|
|
@@ -90,6 +95,17 @@ async function runOAuthAuthorization(
|
|
|
90
95
|
};
|
|
91
96
|
}
|
|
92
97
|
|
|
98
|
+
if (Platform.OS !== 'web') {
|
|
99
|
+
const runtimeReadiness = resolveExpoOAuthBrowserRuntimeReadiness();
|
|
100
|
+
if (runtimeReadiness.status !== 'ready') {
|
|
101
|
+
return {
|
|
102
|
+
status: 'error',
|
|
103
|
+
message: runtimeReadiness.message,
|
|
104
|
+
recoverable: true,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
93
109
|
const started = await oauth.startAuthorization({
|
|
94
110
|
provider: provider.id,
|
|
95
111
|
redirectUri,
|
|
@@ -126,32 +142,35 @@ async function runOAuthAuthorization(
|
|
|
126
142
|
});
|
|
127
143
|
}
|
|
128
144
|
|
|
129
|
-
let
|
|
145
|
+
let browserResponse;
|
|
130
146
|
try {
|
|
131
|
-
browserResult = await WebBrowser.openAuthSessionAsync(
|
|
147
|
+
const browserResult = await WebBrowser.openAuthSessionAsync(
|
|
132
148
|
started.data.authorizationUrl,
|
|
133
149
|
started.data.redirectUri,
|
|
134
150
|
);
|
|
151
|
+
browserResponse = resolveExpoOAuthBrowserResult(browserResult);
|
|
152
|
+
} catch {
|
|
153
|
+
browserResponse = resolveExpoOAuthBrowserException();
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (browserResponse.type === 'callback') {
|
|
157
|
+
return completeOAuthCallback(browserResponse.url);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
let completed: AuthOAuthCompletionResult;
|
|
161
|
+
try {
|
|
162
|
+
completed = await oauth.completeAuthorization({
|
|
163
|
+
attemptId: started.data.attemptId,
|
|
164
|
+
response: browserResponse,
|
|
165
|
+
});
|
|
135
166
|
} catch {
|
|
136
|
-
await cancelOAuthAttempt(started.data.attemptId, 'browser_dismissed');
|
|
137
167
|
await clearTransportAttempt();
|
|
138
168
|
return {
|
|
139
169
|
status: 'error',
|
|
140
|
-
message: 'The
|
|
170
|
+
message: 'The OAuth browser result could not be completed.',
|
|
141
171
|
recoverable: true,
|
|
142
172
|
};
|
|
143
173
|
}
|
|
144
|
-
|
|
145
|
-
if (browserResult.type === 'success' && typeof browserResult.url === 'string') {
|
|
146
|
-
return completeOAuthCallback(browserResult.url);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
const cancellationReason =
|
|
150
|
-
browserResult.type === 'dismiss' ? 'browser_dismissed' : 'user_cancelled';
|
|
151
|
-
const completed = await oauth.completeAuthorization({
|
|
152
|
-
attemptId: started.data.attemptId,
|
|
153
|
-
response: { type: 'cancelled', reason: cancellationReason },
|
|
154
|
-
});
|
|
155
174
|
await clearTransportAttempt();
|
|
156
175
|
return toTransportOutcome(completed);
|
|
157
176
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../../../src/host/layout/templates/auth/oauth.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAMtE,MAAM,UAAU,qBAAqB,CAAC,IAAkC;IACtE,MAAM,aAAa,GAAG,mBAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC9D,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,aAAa,GACjB,IAAI,CAAC,aAAa,CAAC,OAAO,KAAK,SAAS;QACtC,CAAC,CAAC,WAAW;QACb,CAAC,CAAC,IAAI,mBAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC;IAC7D,MAAM,SAAS,GACb,IAAI,CAAC,aAAa,CAAC,GAAG,KAAK,SAAS;QAClC,CAAC,CAAC,WAAW;QACb,CAAC,CAAC,IAAI,mBAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,GAA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;;;;;;;;;;;;;;;CA8WjB,CAAC;AACF,CAAC"}
|
|
@@ -8,7 +8,7 @@ const UTILITY_VERSION = '^0.2.0';
|
|
|
8
8
|
const SUPABASE_AUTH_VERSION = '^1.1.2';
|
|
9
9
|
const SUPABASE_DB_VERSION = '^1.0.0';
|
|
10
10
|
const ZORA_VERSION = '^2.9.0';
|
|
11
|
-
const EXPO_RUNTIME_VERSION = '^2.
|
|
11
|
+
const EXPO_RUNTIME_VERSION = '^2.5.0';
|
|
12
12
|
const EXPO_DOCUMENT_PICKER_VERSION = '~14.0.8';
|
|
13
13
|
const EXPO_FILE_SYSTEM_VERSION = '~19.0.23';
|
|
14
14
|
const EXPO_IMAGE_PICKER_VERSION = '~17.0.11';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/studio",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Studio authoring package for Ankhorage apps",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/studio#readme",
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
"@ankhorage/color-theory": "^0.0.8",
|
|
206
206
|
"@ankhorage/contracts": "^7.8.0",
|
|
207
207
|
"@ankhorage/data-sources": "^1.0.1",
|
|
208
|
-
"@ankhorage/expo-runtime": "^2.
|
|
208
|
+
"@ankhorage/expo-runtime": "^2.5.0",
|
|
209
209
|
"@ankhorage/infra": "^3.3.0",
|
|
210
210
|
"@ankhorage/orchestrator": "^0.3.0",
|
|
211
211
|
"@ankhorage/orchestrator-module-expo-google-fonts": "^0.2.0",
|