@frontegg/ionic-capacitor 2.0.12 → 2.0.13-alpha.24411073037
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,6 +1,7 @@
|
|
|
1
1
|
package com.frontegg.ionic;
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
|
|
4
5
|
import android.os.Handler;
|
|
5
6
|
import android.os.Looper;
|
|
6
7
|
import android.util.Log;
|
|
@@ -101,6 +102,14 @@ public class FronteggNativePlugin extends Plugin {
|
|
|
101
102
|
String clientId = config.getString("clientId");
|
|
102
103
|
String applicationId = config.getString("applicationId");
|
|
103
104
|
|
|
105
|
+
// Allow E2E tests to override the base URL via system property.
|
|
106
|
+
// Tests set this via: System.setProperty("FRONTEGG_E2E_BASE_URL", url)
|
|
107
|
+
String e2eBaseUrl = System.getProperty("FRONTEGG_E2E_BASE_URL");
|
|
108
|
+
if (e2eBaseUrl != null && !e2eBaseUrl.isEmpty()) {
|
|
109
|
+
Log.i("FronteggNative", "E2E override: using base URL " + e2eBaseUrl);
|
|
110
|
+
baseUrl = e2eBaseUrl;
|
|
111
|
+
}
|
|
112
|
+
|
|
104
113
|
if (baseUrl == null || clientId == null) {
|
|
105
114
|
throw new RuntimeException("Missing required config parameters: baseUrl, clientId");
|
|
106
115
|
}
|
|
@@ -55,8 +55,19 @@ public class FronteggNativePlugin: CAPPlugin {
|
|
|
55
55
|
handleLoginWithSSO: handleLoginWithSSO)
|
|
56
56
|
} else {
|
|
57
57
|
print("standard initialization")
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
// E2E test mode: allow overriding baseUrl via environment variable
|
|
59
|
+
// so UI tests can point the SDK at a local mock server.
|
|
60
|
+
let e2eBaseUrl = ProcessInfo.processInfo.environment["FRONTEGG_E2E_BASE_URL"]
|
|
61
|
+
let e2eClientId = ProcessInfo.processInfo.environment["FRONTEGG_E2E_CLIENT_ID"]
|
|
62
|
+
|
|
63
|
+
let resolvedBaseUrl = e2eBaseUrl ?? config.getString("baseUrl")
|
|
64
|
+
let resolvedClientId = e2eClientId ?? config.getString("clientId")
|
|
65
|
+
|
|
66
|
+
if let baseUrl = resolvedBaseUrl,
|
|
67
|
+
let clientId = resolvedClientId {
|
|
68
|
+
if e2eBaseUrl != nil {
|
|
69
|
+
print("Frontegg E2E: using mock server at \(baseUrl)")
|
|
70
|
+
}
|
|
60
71
|
fronteggApp.manualInit(baseUrl: baseUrl,
|
|
61
72
|
cliendId: clientId,
|
|
62
73
|
applicationId: config.getString("applicationId"),
|