@stackable-labs/cli-app-extension 1.100.0 → 1.101.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/dist/index.js +16 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3732,6 +3732,10 @@ var performCLIOAuthFlow = async ({ dashboardUrl, adminApiBaseUrl }) => {
|
|
|
3732
3732
|
await writeAuthState(authState);
|
|
3733
3733
|
return { authState, loginUrl };
|
|
3734
3734
|
};
|
|
3735
|
+
var AUTH_LOGIN_REASON = {
|
|
3736
|
+
NOT_LOGGED_IN: "not-logged-in",
|
|
3737
|
+
EXPIRED: "expired"
|
|
3738
|
+
};
|
|
3735
3739
|
var AuthLogin = ({ dashboardUrl, adminApiBaseUrl, reason, onSuccess, onError }) => {
|
|
3736
3740
|
const { exit } = useApp();
|
|
3737
3741
|
const [state, setState] = useState("waiting");
|
|
@@ -3771,15 +3775,17 @@ var AuthLogin = ({ dashboardUrl, adminApiBaseUrl, reason, onSuccess, onError })
|
|
|
3771
3775
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
3772
3776
|
!reason && /* @__PURE__ */ jsx(Banner, {}),
|
|
3773
3777
|
/* @__PURE__ */ jsxs(StepShell, { title: "Authenticate with Stackable", children: [
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
/* @__PURE__ */ jsxs(Box, { gap: 1, children: [
|
|
3777
|
-
/* @__PURE__ */
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3778
|
+
state === "waiting" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3779
|
+
reason && /* @__PURE__ */ jsx(Box, { marginBottom: 1, children: /* @__PURE__ */ jsx(Text, { color: "yellow", children: reason === AUTH_LOGIN_REASON.EXPIRED ? "Session expired \u2014 re-authenticating before continuing\u2026" : "Not signed in \u2014 opening browser to authenticate\u2026" }) }),
|
|
3780
|
+
/* @__PURE__ */ jsxs(Box, { flexDirection: "column", gap: 1, children: [
|
|
3781
|
+
/* @__PURE__ */ jsxs(Box, { gap: 1, children: [
|
|
3782
|
+
/* @__PURE__ */ jsx(Text, { color: "cyan", children: /* @__PURE__ */ jsx(Spinner5, { type: "dots" }) }),
|
|
3783
|
+
/* @__PURE__ */ jsx(Text, { children: "Waiting for browser authentication..." })
|
|
3784
|
+
] }),
|
|
3785
|
+
loginUrl && /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
3786
|
+
" ",
|
|
3787
|
+
loginUrl
|
|
3788
|
+
] })
|
|
3783
3789
|
] })
|
|
3784
3790
|
] }),
|
|
3785
3791
|
state === "success" && /* @__PURE__ */ jsxs(Box, { flexDirection: "column", gap: 1, children: [
|
|
@@ -3934,7 +3940,7 @@ var ensureToken = async () => {
|
|
|
3934
3940
|
{
|
|
3935
3941
|
dashboardUrl: DASHBOARD_URL,
|
|
3936
3942
|
adminApiBaseUrl: getAdminApiBaseUrl(),
|
|
3937
|
-
reason: isExpired ?
|
|
3943
|
+
reason: isExpired ? AUTH_LOGIN_REASON.EXPIRED : AUTH_LOGIN_REASON.NOT_LOGGED_IN,
|
|
3938
3944
|
onSuccess: (authState) => {
|
|
3939
3945
|
recoveredState = authState;
|
|
3940
3946
|
},
|