Skip to content

Commit

Permalink
fixes the authorize session
Browse files Browse the repository at this point in the history
  • Loading branch information
arch1995 committed Sep 24, 2024
1 parent 1ba98ce commit f99765e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 10 deletions.
40 changes: 34 additions & 6 deletions package-lock.json

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

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@
"dependencies": {
"@toruslabs/constants": "^14.0.0",
"@toruslabs/http-helpers": "^7.0.0",
"@toruslabs/session-manager": "^3.0.0",
"@toruslabs/session-manager": "^3.1.0",
"@web3auth/auth": "^9.4.0",
"buffer": "^6.0.3",
"lodash.clonedeep": "^4.5.0",
"lodash.merge": "^4.6.2",
"loglevel": "^1.9.2",
"react-native-url-polyfill": "^2.0.0"
"react-native-url-polyfill": "^2.0.0",
"urijs": "^1.19.11"
},
"peerDependencies": {
"@babel/runtime": "^7.x",
Expand All @@ -59,6 +60,7 @@
"@types/lodash.merge": "^4.6.9",
"@types/node": "^20",
"@types/react-native": "^0.72.8",
"@types/urijs": "^1.19.25",
"eslint": "^8.53.0",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
Expand All @@ -71,4 +73,4 @@
"node": ">=18.x",
"npm": ">=9.x"
}
}
}
7 changes: 6 additions & 1 deletion src/Web3Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import clonedeep from "lodash.clonedeep";
import merge from "lodash.merge";
import log from "loglevel";
import URI from "urijs";

import { InitializationError, LoginError, RequestError } from "./errors";
import KeyStore from "./session/KeyStore";
Expand Down Expand Up @@ -465,7 +466,11 @@ class Web3Auth implements IWeb3Auth {

private async authorizeSession(): Promise<AuthSessionData> {
try {
const data = await this.sessionManager.authorizeSession();
const data = await this.sessionManager.authorizeSession({
headers: {
Origin: new URI(this.options.redirectUrl).origin(),
},
});
return data;
} catch (error: unknown) {
return {};
Expand Down

0 comments on commit f99765e

Please sign in to comment.