Skip to content

Commit bad3c5a

Browse files
committed
feat(auth): make emoji hash optional
1 parent 2f6ddb1 commit bad3c5a

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

sources/commands/auth/index.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ async function loginWithAppPairing(context: CommandContext): Promise<string> {
226226
const keyPair = generateAppPairingKeyPair();
227227
const publicKey = keyPair.publicKeyBase64;
228228
const secretKey = keyPair.secretKey;
229-
const emoji = formatEmojiHash(keyPair.publicKeyBytes);
229+
const emoji = shouldShowEmojiHash()
230+
? formatEmojiHash(keyPair.publicKeyBytes)
231+
: null;
230232

231233
const initial = await requestAppPairing(context.env, appId, publicKey);
232234

@@ -295,6 +297,14 @@ function formatEmojiHash(publicKeyBytes: Uint8Array): string | null {
295297
return emojis.join(" ");
296298
}
297299

300+
function shouldShowEmojiHash(): boolean {
301+
const value = process.env["BEE_EMOJI_HASH"]?.trim().toLowerCase();
302+
if (!value) {
303+
return true;
304+
}
305+
return !["0", "false", "off", "no"].includes(value);
306+
}
307+
298308
async function pollForAppToken(opts: {
299309
env: Environment;
300310
appId: string;

0 commit comments

Comments
 (0)