ultimate-jekyll-manager 1.3.7 → 1.3.8
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 +7 -0
- package/dist/assets/js/core/auth.js +10 -0
- package/dist/assets/js/libs/auth.js +15 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
14
14
|
- `Fixed` for any bug fixes.
|
|
15
15
|
- `Security` in case of vulnerabilities.
|
|
16
16
|
|
|
17
|
+
---
|
|
18
|
+
## [1.3.8] - 2026-05-24
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- **Reverse-signup now keeps the user on `/signin` so they actually see the inline error.** v1.3.7 fixed `isNewUser` detection, but a follow-on race appeared: when Firebase's `getRedirectResult()` returns a fresh-signup user, the auth-state-change listener in `core/auth.js` fires `state.user = <about-to-be-deleted>` BEFORE `reverseAccidentalSignup`'s `await newUser.delete() → signOut()` chain completes. The listener's `policy === 'unauthenticated'` branch then redirects to `/account` (or `authReturnUrl`), and by the time the inline `showError()` call fires, the user is already off the page. Fixed with a `window.__UJM_REVERSING_SIGNUP` flag set synchronously before the delete + cleared after signOut's followup state-change. The listener checks the flag at the top and short-circuits the entire callback — no redirect, no metadata POST, no consent guard, nothing — until the reversal completes and the user lands on `user = null` with the inline error visible on `/signin`.
|
|
23
|
+
|
|
17
24
|
---
|
|
18
25
|
## [1.3.7] - 2026-05-24
|
|
19
26
|
|
|
@@ -51,6 +51,16 @@ export default function () {
|
|
|
51
51
|
// Log
|
|
52
52
|
console.log('[Auth] state changed:', state);
|
|
53
53
|
|
|
54
|
+
// Short-circuit if a reverse-signup is in progress (libs/auth.js#reverseAccidentalSignup
|
|
55
|
+
// sets this synchronously before .delete() + signOut()). Without this, the brief
|
|
56
|
+
// window where Firebase shows user=<about-to-be-deleted-account> would trigger the
|
|
57
|
+
// policy-based redirect to /account (or authReturnUrl) BEFORE the user sees the
|
|
58
|
+
// inline error on /signin. Flag is cleared at the end of reverseAccidentalSignup.
|
|
59
|
+
if (window.__UJM_REVERSING_SIGNUP) {
|
|
60
|
+
console.warn('[Auth] Skipping state-change processing — reverse-signup in progress');
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
54
64
|
// Set user ID for analytics tracking
|
|
55
65
|
setAnalyticsUserId(user);
|
|
56
66
|
|
|
@@ -125,6 +125,16 @@ export default function () {
|
|
|
125
125
|
async function reverseAccidentalSignup(newUser) {
|
|
126
126
|
console.warn('[Auth] Reversing accidental signup from /signin (new Google account created with no consent on record)');
|
|
127
127
|
|
|
128
|
+
// SYNCHRONOUSLY flag the reversal so the auth-state-change listener in
|
|
129
|
+
// core/auth.js short-circuits its policy-based redirect for this user.
|
|
130
|
+
// Without this, Firebase's redirect-result-success path triggers an auth
|
|
131
|
+
// state change with user=<the-about-to-be-deleted-account> BEFORE we
|
|
132
|
+
// finish .delete() + signOut(), and the listener redirects to /account
|
|
133
|
+
// (or authReturnUrl) before the user ever sees the inline error.
|
|
134
|
+
// Cleared in the finally block after signOut() has fired the followup
|
|
135
|
+
// auth-state-change with user=null.
|
|
136
|
+
window.__UJM_REVERSING_SIGNUP = true;
|
|
137
|
+
|
|
128
138
|
try {
|
|
129
139
|
await newUser.delete();
|
|
130
140
|
} catch (e) {
|
|
@@ -152,6 +162,11 @@ export default function () {
|
|
|
152
162
|
formManager.showError(`This account doesn't exist. Try signing up first or use a different account.`);
|
|
153
163
|
formManager.ready();
|
|
154
164
|
}
|
|
165
|
+
|
|
166
|
+
// Clear the flag now that signOut() has fired its auth-state-change
|
|
167
|
+
// with user=null. Future state changes (e.g. user re-clicks Continue
|
|
168
|
+
// with Google after seeing the error) get normal listener processing.
|
|
169
|
+
window.__UJM_REVERSING_SIGNUP = false;
|
|
155
170
|
}
|
|
156
171
|
|
|
157
172
|
// Validate that the user has agreed to the legal terms. Instead of highlighting the
|