fix: use logical OR for sender ID fallback in command auth
The nullish coalescing operator (??) only skips null/undefined, not empty strings. For direct WhatsApp messages, ctx.SenderId was an empty string, causing senderRaw to be "" instead of falling through to the valid ctx.SenderE164 value. This caused commands like /status to be rejected with "unauthorized sender" for self-chat WhatsApp messages. Tested: Verified /status command now works correctly for self-chat WhatsApp messages after the fix.
This commit is contained in:
committed by
Peter Steinberger
parent
e388334127
commit
20d606c4c4
@@ -96,7 +96,7 @@ export function resolveCommandAuthorization(params: {
|
||||
}
|
||||
const ownerList = ownerCandidates;
|
||||
|
||||
const senderRaw = ctx.SenderId ?? ctx.SenderE164 ?? from;
|
||||
const senderRaw = ctx.SenderId || ctx.SenderE164 || from;
|
||||
const senderId = senderRaw
|
||||
? formatAllowFromList({
|
||||
dock,
|
||||
|
||||
Reference in New Issue
Block a user