@backstage/core-app-api 1.0.3 → 1.0.4-next.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.
- package/CHANGELOG.md +6 -0
- package/dist/index.esm.js +12 -5
- package/dist/index.esm.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @backstage/core-app-api
|
|
2
2
|
|
|
3
|
+
## 1.0.4-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8fe2357101: The `signOut` method of the `IdentityApi` will now navigate the user back to the base URL of the app as indicated by the `app.baseUrl` config.
|
|
8
|
+
|
|
3
9
|
## 1.0.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.esm.js
CHANGED
|
@@ -2031,12 +2031,14 @@ class AppIdentityProxy {
|
|
|
2031
2031
|
constructor() {
|
|
2032
2032
|
this.resolveTarget = () => {
|
|
2033
2033
|
};
|
|
2034
|
+
this.signOutTargetUrl = "/";
|
|
2034
2035
|
this.waitForTarget = new Promise((resolve) => {
|
|
2035
2036
|
this.resolveTarget = resolve;
|
|
2036
2037
|
});
|
|
2037
2038
|
}
|
|
2038
|
-
setTarget(identityApi) {
|
|
2039
|
+
setTarget(identityApi, targetOptions) {
|
|
2039
2040
|
this.target = identityApi;
|
|
2041
|
+
this.signOutTargetUrl = targetOptions.signOutTargetUrl;
|
|
2040
2042
|
this.resolveTarget(identityApi);
|
|
2041
2043
|
}
|
|
2042
2044
|
getUserId() {
|
|
@@ -2083,7 +2085,7 @@ class AppIdentityProxy {
|
|
|
2083
2085
|
}
|
|
2084
2086
|
async signOut() {
|
|
2085
2087
|
await this.waitForTarget.then((target) => target.signOut());
|
|
2086
|
-
location.
|
|
2088
|
+
location.href = this.signOutTargetUrl;
|
|
2087
2089
|
}
|
|
2088
2090
|
}
|
|
2089
2091
|
|
|
@@ -2377,17 +2379,22 @@ class AppManager {
|
|
|
2377
2379
|
children
|
|
2378
2380
|
}) => {
|
|
2379
2381
|
const [identityApi, setIdentityApi] = useState();
|
|
2382
|
+
const configApi = useApi(configApiRef);
|
|
2383
|
+
const basePath = getBasePath(configApi);
|
|
2380
2384
|
if (!identityApi) {
|
|
2381
2385
|
return /* @__PURE__ */ React.createElement(Component, {
|
|
2382
2386
|
onSignInSuccess: setIdentityApi
|
|
2383
2387
|
});
|
|
2384
2388
|
}
|
|
2385
|
-
this.appIdentityProxy.setTarget(identityApi
|
|
2389
|
+
this.appIdentityProxy.setTarget(identityApi, {
|
|
2390
|
+
signOutTargetUrl: basePath || "/"
|
|
2391
|
+
});
|
|
2386
2392
|
return children;
|
|
2387
2393
|
};
|
|
2388
2394
|
const AppRouter = ({ children }) => {
|
|
2389
2395
|
const configApi = useApi(configApiRef);
|
|
2390
|
-
const
|
|
2396
|
+
const basePath = getBasePath(configApi);
|
|
2397
|
+
const mountPath = `${basePath}/*`;
|
|
2391
2398
|
const { routeObjects } = useContext(InternalAppContext);
|
|
2392
2399
|
if (!SignInPageComponent) {
|
|
2393
2400
|
this.appIdentityProxy.setTarget({
|
|
@@ -2409,7 +2416,7 @@ class AppManager {
|
|
|
2409
2416
|
getCredentials: async () => ({}),
|
|
2410
2417
|
signOut: async () => {
|
|
2411
2418
|
}
|
|
2412
|
-
});
|
|
2419
|
+
}, { signOutTargetUrl: basePath || "/" });
|
|
2413
2420
|
return /* @__PURE__ */ React.createElement(RouterComponent, null, /* @__PURE__ */ React.createElement(RouteTracker, {
|
|
2414
2421
|
routeObjects
|
|
2415
2422
|
}), /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(Route, {
|