Skip to content

Commit

Permalink
Merge pull request #305 from torusresearch/fix/btoa
Browse files Browse the repository at this point in the history
use safebtoa instead of btoa
  • Loading branch information
chaitanyapotti authored Sep 22, 2023
2 parents 14a5a90 + 007f70b commit 80ea062
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@toruslabs/http-helpers": "^5.0.0",
"@toruslabs/metadata-helpers": "^5.0.0",
"@toruslabs/torus.js": "^11.0.5",
"base64url": "^3.0.1",
"bowser": "^2.11.0",
"events": "^3.3.0",
"jwt-decode": "^3.1.2",
Expand Down
3 changes: 2 additions & 1 deletion src/handlers/AbstractLoginHandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { BroadcastChannel } from "@toruslabs/broadcast-channel";
import base64url from "base64url";

import { LOGIN_TYPE, UX_MODE, UX_MODE_TYPE } from "../utils/enums";
import { broadcastChannelOptions, getTimeout, randomId } from "../utils/helpers";
Expand Down Expand Up @@ -26,7 +27,7 @@ abstract class AbstractLoginHandler implements ILoginHandler {

get state(): string {
return encodeURIComponent(
window.btoa(
base64url.encode(
JSON.stringify({
...(this.customState || {}),
instanceId: this.nonce,
Expand Down

0 comments on commit 80ea062

Please sign in to comment.