@digital-ai/dot-illustrations 2.0.35 → 2.0.36
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/demo/github-upload.js +6 -9
- package/demo/script.js +1 -6
- package/package.json +1 -1
package/demo/github-upload.js
CHANGED
|
@@ -17,17 +17,14 @@ const GITHUB_UPLOAD_CONFIG = {
|
|
|
17
17
|
SCOPES: 'public_repo',
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
const STORAGE_USER_KEY = 'gh_illus_user';
|
|
20
|
+
// ─── In-memory token (never persisted — cleared when page closes) ────────────
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
let _ghToken = null;
|
|
23
|
+
let _ghUser = null;
|
|
24
24
|
|
|
25
|
-
function ghGetToken() { return
|
|
26
|
-
function ghSetToken(t) {
|
|
27
|
-
function ghClearToken() {
|
|
28
|
-
localStorage.removeItem(STORAGE_TOKEN_KEY);
|
|
29
|
-
localStorage.removeItem(STORAGE_USER_KEY);
|
|
30
|
-
}
|
|
25
|
+
function ghGetToken() { return _ghToken; }
|
|
26
|
+
function ghSetToken(t) { _ghToken = t; }
|
|
27
|
+
function ghClearToken() { _ghToken = null; _ghUser = null; }
|
|
31
28
|
|
|
32
29
|
// ─── GitHub API helpers ──────────────────────────────────────────────────────
|
|
33
30
|
|
package/demo/script.js
CHANGED
|
@@ -516,7 +516,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
516
516
|
badge.classList.remove('hidden');
|
|
517
517
|
badge.style.display = 'flex';
|
|
518
518
|
name.textContent = `@${user.login}`;
|
|
519
|
-
localStorage.setItem('gh_illus_user', JSON.stringify(user));
|
|
520
519
|
} else {
|
|
521
520
|
btn.classList.remove('hidden');
|
|
522
521
|
badge.style.display = 'none';
|
|
@@ -591,11 +590,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
591
590
|
}
|
|
592
591
|
});
|
|
593
592
|
|
|
594
|
-
//
|
|
595
|
-
const savedUser = localStorage.getItem('gh_illus_user');
|
|
596
|
-
if (window.GitHubUpload?.getToken?.() && savedUser) {
|
|
597
|
-
try { updateAuthBadge(JSON.parse(savedUser)); } catch {}
|
|
598
|
-
}
|
|
593
|
+
// No session restore — token is in-memory only for security
|
|
599
594
|
|
|
600
595
|
// ── Upload panel ─────────────────────────────────────────────────────────
|
|
601
596
|
const uploadBufs = { illusLight: null, illusDark: null, integSvg: null };
|
package/package.json
CHANGED