@ebubekirylmaz/link-test 1.1.7 → 1.1.9
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/package.json
CHANGED
|
@@ -94,8 +94,23 @@ function ProjectBar() {
|
|
|
94
94
|
const refreshToken = storage.get("link", "refreshToken");
|
|
95
95
|
const identityProvider = storage.get("link", "identityProvider");
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
const isDemo = identityProvider?.toUpperCase() === "DEMO";
|
|
98
|
+
|
|
99
|
+
const request = isDemo
|
|
100
|
+
? oauth.post("/auth/demo", {
|
|
101
|
+
appId,
|
|
102
|
+
projectId,
|
|
103
|
+
username: "admin",
|
|
104
|
+
password: "admin",
|
|
105
|
+
})
|
|
106
|
+
: oauth.post("/oauth", {
|
|
107
|
+
appId,
|
|
108
|
+
refreshToken,
|
|
109
|
+
projectId,
|
|
110
|
+
identityProvider,
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
request
|
|
99
114
|
.then(({ data }) => {
|
|
100
115
|
const { refreshToken, accessToken } = data;
|
|
101
116
|
storage.set("link", "accessToken", accessToken);
|
|
@@ -104,9 +119,7 @@ function ProjectBar() {
|
|
|
104
119
|
})
|
|
105
120
|
.finally(() => {
|
|
106
121
|
setSelectedProject(project);
|
|
107
|
-
|
|
108
122
|
publish("PROJECT_SELECTED", { projectId });
|
|
109
|
-
|
|
110
123
|
search.onFalse();
|
|
111
124
|
setSearchQuery("");
|
|
112
125
|
});
|