Add missing hasPassword property to user responses
The API contract requires hasPassword in user responses but it was missing from toUserResponse helper and meAuthStatus handler. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,7 @@ export const toUserResponse = (user: Selectable<Users>) => ({
|
||||
emailVerified: user.email_verified_at !== null,
|
||||
needsSetup: user.display_name === null,
|
||||
isSuperuser: user.is_superuser,
|
||||
hasPassword: user.password_hash !== null,
|
||||
});
|
||||
|
||||
/** Transform site record to API response format */
|
||||
|
||||
@@ -201,6 +201,7 @@ const meAuthStatus = os.me.authStatus
|
||||
"avatar_url",
|
||||
"email_verified_at",
|
||||
"is_superuser",
|
||||
"password_hash",
|
||||
])
|
||||
.where("id", "=", context.user.id)
|
||||
.executeTakeFirstOrThrow();
|
||||
@@ -216,6 +217,7 @@ const meAuthStatus = os.me.authStatus
|
||||
emailVerified: user.email_verified_at !== null,
|
||||
needsSetup: user.display_name === null,
|
||||
isSuperuser: user.is_superuser,
|
||||
hasPassword: user.password_hash !== null,
|
||||
},
|
||||
auth: context.auth,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user