mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-09 18:29:21 +00:00
Decode base64url
This commit is contained in:
@@ -32,7 +32,10 @@ export const useE2eeConfig = (
|
|||||||
// as such. Otherwise, we assume it's an old-style password and use it as a string.
|
// as such. Otherwise, we assume it's an old-style password and use it as a string.
|
||||||
try {
|
try {
|
||||||
const itFunc = function* () {
|
const itFunc = function* () {
|
||||||
const decoded = atob(passwordString);
|
const decoded = atob(
|
||||||
|
// built-in atob doesn't support base64url, so convert
|
||||||
|
passwordString.replace("-", "+").replace("_", "/")
|
||||||
|
);
|
||||||
for (let i = 0; i < decoded.length; ++i) {
|
for (let i = 0; i < decoded.length; ++i) {
|
||||||
yield decoded.charCodeAt(i);
|
yield decoded.charCodeAt(i);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user