@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebubekirylmaz/link-test",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "exports": {
@@ -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
- oauth
98
- .post("/oauth", { appId, refreshToken, projectId, identityProvider })
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
  });
@@ -27,6 +27,7 @@ export default function DemoLogin() {
27
27
 
28
28
  storage.set("link", "accessToken", data.accessToken);
29
29
  storage.set("link", "refreshToken", data.refreshToken);
30
+ storage.set("link", "identityProvider", "Demo");
30
31
 
31
32
  navigate("/");
32
33
  }