@lvce-editor/auth-worker 3.4.0 → 3.5.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.
@@ -2498,6 +2498,10 @@ const waitForBackendLogin = async (backendUrl, timeoutMs = 30_000, pollIntervalM
2498
2498
  return getLoggedOutBackendAuthState(lastErrorMessage);
2499
2499
  };
2500
2500
 
2501
+ const getAuthUseRedirect = platform => {
2502
+ return platform !== Electron;
2503
+ };
2504
+
2501
2505
  // cspell:ignore pkce
2502
2506
 
2503
2507
  const createPkceValues = async () => {
@@ -2898,7 +2902,8 @@ const getMockLoginResult = async signingInState => {
2898
2902
  }
2899
2903
  return persistLoginResult(getLoggedInState(signingInState, response));
2900
2904
  };
2901
- const getInteractiveLoginResult = async (backendUrl, platform, authUseRedirect, signingInState) => {
2905
+ const getInteractiveLoginResult = async (backendUrl, platform, signingInState) => {
2906
+ const authUseRedirect = getAuthUseRedirect(platform);
2902
2907
  const uid = 0;
2903
2908
  const {
2904
2909
  clientId,
@@ -2930,7 +2935,6 @@ const getInteractiveLoginResult = async (backendUrl, platform, authUseRedirect,
2930
2935
  };
2931
2936
  const handleClickLogin = async options => {
2932
2937
  const {
2933
- authUseRedirect,
2934
2938
  backendUrl,
2935
2939
  platform
2936
2940
  } = options;
@@ -2949,7 +2953,7 @@ const handleClickLogin = async options => {
2949
2953
  if (mockLoginResult) {
2950
2954
  return mockLoginResult;
2951
2955
  }
2952
- return getInteractiveLoginResult(backendUrl, platform, authUseRedirect, signingInState);
2956
+ return getInteractiveLoginResult(backendUrl, platform, signingInState);
2953
2957
  } catch (error) {
2954
2958
  await clearPendingOidcAuthState();
2955
2959
  const errorMessage = error instanceof Error && error.message ? error.message : 'Backend authentication failed.';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/auth-worker",
3
- "version": "3.4.0",
3
+ "version": "3.5.0",
4
4
  "description": "Auth Worker",
5
5
  "repository": {
6
6
  "type": "git",