-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3682 from himdel/password-utf-bz1527316
API js - use base64encode which can deal with UTF8 passwords (cherry picked from commit aa6b2fd) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1562797
- Loading branch information
Showing
4 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import base64js from 'base64-js'; | ||
import TextEncoderLite from 'text-encoder-lite'; | ||
|
||
// utf8-capable window.btoa | ||
window.base64encode = (str, encoding = 'utf-8') => { | ||
let bytes = new (TextEncoder || TextEncoderLite)(encoding).encode(str); | ||
return base64js.fromByteArray(bytes); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters