@lvce-editor/auth-worker 3.12.0 → 3.13.1

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.
@@ -1078,6 +1078,15 @@ const {
1078
1078
  invoke: invoke$2,
1079
1079
  set: set$1
1080
1080
  } = create(MainProcess);
1081
+ const deleteSecret$1 = async (extensionId, key) => {
1082
+ await invoke$2('SecretStorage.delete', extensionId, key);
1083
+ };
1084
+ const getSecret$1 = async (extensionId, key) => {
1085
+ return invoke$2('SecretStorage.get', extensionId, key);
1086
+ };
1087
+ const storeSecret$1 = async (extensionId, key, value) => {
1088
+ await invoke$2('SecretStorage.store', extensionId, key, value);
1089
+ };
1081
1090
 
1082
1091
  const {
1083
1092
  invoke: invoke$1,
@@ -1162,14 +1171,13 @@ const setAuthPlatform = value => {
1162
1171
 
1163
1172
  const authStorageId = 'lvce-editor.auth';
1164
1173
  const deleteSecret = async key => {
1165
- await invoke$2('SecretStorage.delete', authStorageId, key);
1174
+ await deleteSecret$1(authStorageId, key);
1166
1175
  };
1167
1176
  const getSecret = async key => {
1168
- const value = await invoke$2('SecretStorage.get', authStorageId, key);
1169
- return typeof value === 'string' ? value : '';
1177
+ return (await getSecret$1(authStorageId, key)) ?? '';
1170
1178
  };
1171
1179
  const storeSecret = async (key, value) => {
1172
- await invoke$2('SecretStorage.store', authStorageId, key, value);
1180
+ await storeSecret$1(authStorageId, key, value);
1173
1181
  };
1174
1182
 
1175
1183
  const databaseName = 'auth-worker';
@@ -2658,7 +2666,7 @@ const syncBackendAuth = async backendUrl => {
2658
2666
  if (!parsed.authAccessToken) {
2659
2667
  return getLoggedOutBackendAuthState();
2660
2668
  }
2661
- return parsed;
2669
+ return persistLoginResult(parsed);
2662
2670
  } catch (error) {
2663
2671
  const authErrorMessage = error instanceof Error && error.message ? error.message : 'Backend authentication failed.';
2664
2672
  return getLoggedOutBackendAuthState(authErrorMessage);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/auth-worker",
3
- "version": "3.12.0",
3
+ "version": "3.13.1",
4
4
  "description": "Auth Worker",
5
5
  "repository": {
6
6
  "type": "git",