Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions packages/gateway/src/whatsapp/connection/auth-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,13 @@ export function createAuthState(initialState: AuthState | null): {
}

/**
* Log credentials update instruction for the user.
* Log credentials update without emitting credential material.
*/
export function logCredentialsUpdateInstruction(serialized: string): void {
export function logCredentialsUpdateInstruction(
serializedLength: number
): void {
logger.info(
"WhatsApp credentials updated. To persist, update your environment:"
{ serializedLength },
"WhatsApp credentials updated in memory; persist via secure secret storage (WHATSAPP_CREDENTIALS)."
);
logger.info(`WHATSAPP_CREDENTIALS=${serialized}`);
}
2 changes: 1 addition & 1 deletion packages/gateway/src/whatsapp/connection/baileys-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export class BaileysClient extends EventEmitter<BaileysClientEvents> {
if (this.authState) {
const serialized = await this.authState.saveCreds();
this.emit("credentialsUpdated", serialized);
logCredentialsUpdateInstruction(serialized);
logCredentialsUpdateInstruction(serialized.length);
}
});

Expand Down
Loading