@lvce-editor/auth-worker 1.8.0 → 1.10.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.
- package/dist/authWorkerMain.js +27 -7
- package/package.json +1 -1
package/dist/authWorkerMain.js
CHANGED
|
@@ -1080,7 +1080,7 @@ const createMockRpc = ({
|
|
|
1080
1080
|
};
|
|
1081
1081
|
|
|
1082
1082
|
const rpcs = Object.create(null);
|
|
1083
|
-
const set$
|
|
1083
|
+
const set$3 = (id, rpc) => {
|
|
1084
1084
|
rpcs[id] = rpc;
|
|
1085
1085
|
};
|
|
1086
1086
|
const get = id => {
|
|
@@ -1113,7 +1113,7 @@ const create = rpcId => {
|
|
|
1113
1113
|
const mockRpc = createMockRpc({
|
|
1114
1114
|
commandMap
|
|
1115
1115
|
});
|
|
1116
|
-
set$
|
|
1116
|
+
set$3(rpcId, mockRpc);
|
|
1117
1117
|
// @ts-ignore
|
|
1118
1118
|
mockRpc[Symbol.dispose] = () => {
|
|
1119
1119
|
remove(rpcId);
|
|
@@ -1122,11 +1122,16 @@ const create = rpcId => {
|
|
|
1122
1122
|
return mockRpc;
|
|
1123
1123
|
},
|
|
1124
1124
|
set(rpc) {
|
|
1125
|
-
set$
|
|
1125
|
+
set$3(rpcId, rpc);
|
|
1126
1126
|
}
|
|
1127
1127
|
};
|
|
1128
1128
|
};
|
|
1129
1129
|
|
|
1130
|
+
const {
|
|
1131
|
+
invoke: invoke$2,
|
|
1132
|
+
set: set$2
|
|
1133
|
+
} = create(6040);
|
|
1134
|
+
|
|
1130
1135
|
const Electron = 2;
|
|
1131
1136
|
|
|
1132
1137
|
const OpenerWorker = 4561;
|
|
@@ -1146,6 +1151,21 @@ const sendMessagePortToOpenerWorker$1 = async (port, rpcId) => {
|
|
|
1146
1151
|
const command = 'HandleMessagePort.handleMessagePort';
|
|
1147
1152
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToOpenerWorker', port, command, rpcId);
|
|
1148
1153
|
};
|
|
1154
|
+
const sendMessagePortToSharedProcess = async port => {
|
|
1155
|
+
const command = 'HandleElectronMessagePort.handleElectronMessagePort';
|
|
1156
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, 0);
|
|
1157
|
+
};
|
|
1158
|
+
|
|
1159
|
+
const sendMessagePortToAuthProcess = async port => {
|
|
1160
|
+
await sendMessagePortToSharedProcess(port);
|
|
1161
|
+
};
|
|
1162
|
+
const initializeAuthProcess = async () => {
|
|
1163
|
+
const rpc = await create$3({
|
|
1164
|
+
commandMap: {},
|
|
1165
|
+
send: sendMessagePortToAuthProcess
|
|
1166
|
+
});
|
|
1167
|
+
set$2(rpc);
|
|
1168
|
+
};
|
|
1149
1169
|
|
|
1150
1170
|
const sendMessagePortToOpenerWorker = async port => {
|
|
1151
1171
|
await sendMessagePortToOpenerWorker$1(port, 0);
|
|
@@ -1613,8 +1633,8 @@ const errorHtml = `<!doctype html>
|
|
|
1613
1633
|
</body>
|
|
1614
1634
|
</html>`;
|
|
1615
1635
|
|
|
1616
|
-
const getElectronRedirectUri = async
|
|
1617
|
-
const localOauthServerPort = await invoke('OAuthServer.create', String(uid), successHtml, errorHtml);
|
|
1636
|
+
const getElectronRedirectUri = async uid => {
|
|
1637
|
+
const localOauthServerPort = await invoke$2('OAuthServer.create', String(uid), successHtml, errorHtml);
|
|
1618
1638
|
return `http://localhost:${localOauthServerPort}`;
|
|
1619
1639
|
};
|
|
1620
1640
|
|
|
@@ -1623,7 +1643,7 @@ const getEffectiveRedirectUri = async (platform, uid, redirectUri) => {
|
|
|
1623
1643
|
return redirectUri;
|
|
1624
1644
|
}
|
|
1625
1645
|
if (platform === Electron) {
|
|
1626
|
-
return getElectronRedirectUri(uid
|
|
1646
|
+
return getElectronRedirectUri(uid);
|
|
1627
1647
|
}
|
|
1628
1648
|
return getCurrentHref();
|
|
1629
1649
|
};
|
|
@@ -1799,7 +1819,7 @@ const initializeRendererWorker = async () => {
|
|
|
1799
1819
|
};
|
|
1800
1820
|
|
|
1801
1821
|
const listen = async () => {
|
|
1802
|
-
await Promise.all([initializeRendererWorker(), initializeOpenerWorker()]);
|
|
1822
|
+
await Promise.all([initializeRendererWorker(), initializeOpenerWorker(), initializeAuthProcess()]);
|
|
1803
1823
|
};
|
|
1804
1824
|
|
|
1805
1825
|
const main = async () => {
|