diff --git a/lib/routes/api/speech-credentials.js b/lib/routes/api/speech-credentials.js index 74fd2e9..86c7e59 100644 --- a/lib/routes/api/speech-credentials.js +++ b/lib/routes/api/speech-credentials.js @@ -19,6 +19,10 @@ const obscureKey = (key) => { const key_spoiler_length = 6; const key_spoiler_char = 'X'; + if (key.length <= key_spoiler_length) { + return key; + } + return `${key.slice(0, key_spoiler_length)}${key_spoiler_char.repeat(key.length - key_spoiler_length)}`; };