Skip to content

Commit 48652c4

Browse files
committed
fix: unwrap JSONResponse envelope in MFA status UI
/user/mfa/status returns {success, messages, data: {mfaEnabled, ...}} but the badge renderer read the fields from the top level. Every field came back undefined, so a fully-authenticated user was always shown the 'Additional Factor Required' badge and never the MFA Active / Fully Authenticated ones.
1 parent 40408ca commit 48652c4

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/main/resources/static/js/user/webauthn-manage.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,15 @@ async function updateMfaStatusUI() {
284284
return;
285285
}
286286

287-
const status = await response.json();
287+
// The endpoint wraps the status in the framework's JSONResponse envelope:
288+
// { success, messages, data: { mfaEnabled, fullyAuthenticated, ... } }
289+
const body = await response.json();
290+
const status = body.data;
291+
if (!status) {
292+
console.warn('MFA status response missing data payload');
293+
container.classList.add('d-none');
294+
return;
295+
}
288296
container.classList.remove('d-none');
289297

290298
// Build MFA badges using safe DOM methods

0 commit comments

Comments
 (0)