feat: remove legacy "data_unlocked" field

This commit is contained in:
LukeGus
2026-07-16 14:49:35 -05:00
parent f3a4d5662c
commit 552ceefec2
3 changed files with 6 additions and 11 deletions
@@ -465,12 +465,12 @@ export function registerUserWebAuthnRoutes(
}
const deviceInfo = parseUserAgent(req);
const dataUnlocked = await authManager.authenticateWebAuthnUser(
const authenticated = await authManager.authenticateWebAuthnUser(
userRecord.id,
deviceInfo.type,
);
if (!dataUnlocked) {
if (!authenticated) {
return res.status(401).json({
error:
"Passkey cannot unlock this account. Log in with password and register the passkey again.",
@@ -530,7 +530,6 @@ export function registerUserWebAuthnRoutes(
userId: userRecord.id,
is_oidc: !!userRecord.isOidc,
totp_enabled: !!userRecord.totpEnabled,
data_unlocked: true,
...(isNativeAppRequest(req) ? { token } : {}),
});
} catch (error) {
+4 -5
View File
@@ -1510,21 +1510,21 @@ router.post("/login", async (req, res) => {
const deviceInfo = parseUserAgent(req);
let dataUnlocked = false;
let authenticated = false;
if (userRecord.isOidc) {
dataUnlocked = await authManager.authenticateOIDCUser(
authenticated = await authManager.authenticateOIDCUser(
userRecord.id,
deviceInfo.type,
);
} else {
dataUnlocked = await authManager.authenticateUser(
authenticated = await authManager.authenticateUser(
userRecord.id,
password,
deviceInfo.type,
);
}
if (!dataUnlocked) {
if (!authenticated) {
return res.status(401).json({ error: "Incorrect password" });
}
@@ -1771,7 +1771,6 @@ router.get("/me", authenticateJWT, async (req: Request, res: Response) => {
is_oidc: !!user.isOidc,
is_dual_auth: isDualAuth,
totp_enabled: !!user.totpEnabled,
data_unlocked: authManager.isUserUnlocked(userId),
});
} catch (err) {
authLogger.error("Failed to get username", err);