@vasanthcambium/marketplace-auth 0.1.2 → 0.1.3
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.
|
@@ -27,6 +27,7 @@ function AuthScreen({ error }) {
|
|
|
27
27
|
return (_jsxs(Screen, { children: [_jsx("h1", { style: styles.heading, children: "Not Authenticated" }), _jsx("p", { style: styles.body, children: "Please launch this app from the cnMaestro marketplace." })] }));
|
|
28
28
|
}
|
|
29
29
|
function DevLoginForm() {
|
|
30
|
+
const [cfDomain, setCfDomain] = useState('');
|
|
30
31
|
const [clientId, setClientId] = useState('');
|
|
31
32
|
const [clientSecret, setClientSecret] = useState('');
|
|
32
33
|
const [busy, setBusy] = useState(false);
|
|
@@ -39,7 +40,7 @@ function DevLoginForm() {
|
|
|
39
40
|
const res = await fetch('/api/__dev-auth__', {
|
|
40
41
|
method: 'POST',
|
|
41
42
|
headers: { 'content-type': 'application/json' },
|
|
42
|
-
body: JSON.stringify({ clientId, clientSecret }),
|
|
43
|
+
body: JSON.stringify({ cfDomain, clientId, clientSecret }),
|
|
43
44
|
});
|
|
44
45
|
if (!res.ok) {
|
|
45
46
|
const j = await res.json().catch(() => ({}));
|
|
@@ -54,7 +55,7 @@ function DevLoginForm() {
|
|
|
54
55
|
setBusy(false);
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
return (_jsxs(Screen, { children: [_jsx("div", { style: styles.devBadge, children: "DEV MODE" }), _jsx("h1", { style: styles.heading, children: "Connect to cnMaestro" }), _jsx("p", { style: styles.body, children: "Enter your NBI API credentials to start the local dev session." }), _jsxs("form", { onSubmit: handleSubmit, style: styles.form, children: [_jsxs("label", { style: styles.label, children: ["Client ID", _jsx("input", { style: styles.input, type: "text", value: clientId, onChange: (e) => setClientId(e.target.value), placeholder: "your-client-id", required: true
|
|
58
|
+
return (_jsxs(Screen, { children: [_jsx("div", { style: styles.devBadge, children: "DEV MODE" }), _jsx("h1", { style: styles.heading, children: "Connect to cnMaestro" }), _jsx("p", { style: styles.body, children: "Enter your NBI API credentials to start the local dev session." }), _jsxs("form", { onSubmit: handleSubmit, style: styles.form, children: [_jsxs("label", { style: styles.label, children: ["Platform URL", _jsx("input", { style: styles.input, type: "url", value: cfDomain, onChange: (e) => setCfDomain(e.target.value.replace(/\/$/, '')), placeholder: "https://dev.test-easy-apps.cloud.cambiumnetworks.com", required: true, autoFocus: true, autoComplete: "off" })] }), _jsxs("label", { style: styles.label, children: ["Client ID", _jsx("input", { style: styles.input, type: "text", value: clientId, onChange: (e) => setClientId(e.target.value), placeholder: "your-client-id", required: true })] }), _jsxs("label", { style: styles.label, children: ["Client Secret", _jsx("input", { style: styles.input, type: "password", value: clientSecret, onChange: (e) => setClientSecret(e.target.value), placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", autoComplete: "off", required: true })] }), err && _jsx("p", { style: styles.formError, children: err }), _jsx("button", { type: "submit", style: styles.button, disabled: busy, children: busy ? 'Connecting…' : 'Connect' })] })] }));
|
|
58
59
|
}
|
|
59
60
|
function Screen({ children }) {
|
|
60
61
|
return (_jsx("div", { style: styles.screen, children: _jsx("div", { style: styles.card, children: children }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionGate.js","sourceRoot":"","sources":["../../src/react/SessionGate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAQ1D;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAoB;IAClE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,UAAU,EAAE,CAAC;IAEjD,IAAI,CAAC,OAAO;QAAE,OAAO,KAAC,MAAM,cAAC,YAAG,KAAK,EAAE,MAAM,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