static-web-apps-cli
static-web-apps-cli copied to clipboard
fix: handle Unicode characters in auth emulator usernames
Summary
- Fixed issue where usernames containing Unicode characters (emojis, non-Latin text) would cause btoa() to throw an error
- Applied UTF-8 encoding before base64 encoding to properly handle Unicode characters
Changes
- Updated
saveCookie()function insrc/public/auth.htmlto usebtoa(unescape(encodeURIComponent(data)))instead ofbtoa(data) - This ensures Unicode characters are properly encoded to UTF-8 before base64 encoding
Test plan
- [x] Tested with various Unicode inputs including emojis (😊), Chinese characters (用户), and Arabic text (مستخدم)
- [x] Verified ASCII characters still work correctly
- [x] All existing unit tests pass
Fixes #269
🤖 Generated with Claude Code