central-auth-js-sdk 1.2.2 → 1.2.4
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/core/env-config.js +1 -1
- package/login.js +1 -1
- package/package.json +1 -1
- package/signup.js +1 -0
- package/ui/layout.js +20 -0
- package/ui/screens/face-registration.js +8 -0
- package/ui/screens/login/frs.js +8 -0
package/core/env-config.js
CHANGED
|
@@ -11,7 +11,7 @@ export const ENV_API_URLS = {
|
|
|
11
11
|
local: 'http://localhost:8080',
|
|
12
12
|
dev: 'https://central-auth-dev.soham.ai/apis',
|
|
13
13
|
staging: 'https://central-auth-staging.soham.ai/apis',
|
|
14
|
-
prod: 'https://central-auth.soham.ai/apis',
|
|
14
|
+
prod: 'https://central-auth-prod.soham.ai/apis',
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
/**
|
package/login.js
CHANGED
|
@@ -353,7 +353,7 @@ export function mountLogin(container, options = {}) {
|
|
|
353
353
|
}
|
|
354
354
|
|
|
355
355
|
return {
|
|
356
|
-
unmount() { cleanupTheme(); layout.root.remove(); },
|
|
356
|
+
unmount() { cleanupTheme(); layout.cleanup(); layout.root.remove(); },
|
|
357
357
|
getState() { return state.getAll(); },
|
|
358
358
|
getFlow() { return flow; },
|
|
359
359
|
getCurrentStep() { return flow.getCurrentStep(); },
|
package/package.json
CHANGED
package/signup.js
CHANGED
package/ui/layout.js
CHANGED
|
@@ -67,6 +67,14 @@ export function createLayout(container) {
|
|
|
67
67
|
const loadingStatus = root.querySelector('#wf-loading-status');
|
|
68
68
|
|
|
69
69
|
function setContent(el) {
|
|
70
|
+
const oldEl = formInner.firstElementChild;
|
|
71
|
+
if (oldEl && typeof oldEl.cleanup === 'function') {
|
|
72
|
+
try {
|
|
73
|
+
oldEl.cleanup();
|
|
74
|
+
} catch (e) {
|
|
75
|
+
console.error('[Central Auth SDK] Error during screen cleanup:', e);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
70
78
|
formInner.innerHTML = '';
|
|
71
79
|
if (el) formInner.appendChild(el);
|
|
72
80
|
}
|
|
@@ -116,12 +124,24 @@ export function createLayout(container) {
|
|
|
116
124
|
}
|
|
117
125
|
}
|
|
118
126
|
|
|
127
|
+
function cleanup() {
|
|
128
|
+
const oldEl = formInner.firstElementChild;
|
|
129
|
+
if (oldEl && typeof oldEl.cleanup === 'function') {
|
|
130
|
+
try {
|
|
131
|
+
oldEl.cleanup();
|
|
132
|
+
} catch (e) {
|
|
133
|
+
console.error('[Central Auth SDK] Error during screen cleanup:', e);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
119
138
|
return {
|
|
120
139
|
root,
|
|
121
140
|
setContent,
|
|
122
141
|
updateProgress,
|
|
123
142
|
showError,
|
|
124
143
|
setLoading,
|
|
144
|
+
cleanup,
|
|
125
145
|
renderContent: setContent,
|
|
126
146
|
};
|
|
127
147
|
}
|
|
@@ -174,5 +174,13 @@ export function createFaceRegistrationScreen(onNext, onBack, api) {
|
|
|
174
174
|
const usePhoneBtn = wrap.querySelector('[data-action="use-phone"]');
|
|
175
175
|
if (usePhoneBtn) usePhoneBtn.addEventListener('click', () => showPhoneCapture(true));
|
|
176
176
|
|
|
177
|
+
wrap.cleanup = () => {
|
|
178
|
+
stopStream();
|
|
179
|
+
if (phoneCaptureRef) {
|
|
180
|
+
phoneCaptureRef.destroy();
|
|
181
|
+
phoneCaptureRef = null;
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
|
|
177
185
|
return wrap;
|
|
178
186
|
}
|
package/ui/screens/login/frs.js
CHANGED
|
@@ -183,5 +183,13 @@ export function createLoginFrsScreen(onNext, onBack, opts = {}) {
|
|
|
183
183
|
const usePhoneBtn = wrap.querySelector('[data-action="use-phone"]');
|
|
184
184
|
if (usePhoneBtn) usePhoneBtn.addEventListener('click', () => showPhoneCapture(true));
|
|
185
185
|
|
|
186
|
+
wrap.cleanup = () => {
|
|
187
|
+
stopStream();
|
|
188
|
+
if (phoneCaptureRef) {
|
|
189
|
+
phoneCaptureRef.destroy();
|
|
190
|
+
phoneCaptureRef = null;
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
|
|
186
194
|
return wrap;
|
|
187
195
|
}
|