Skip to content

Commit f99765e

Browse files
committed
fixes the authorize session
1 parent 1ba98ce commit f99765e

File tree

3 files changed

+45
-10
lines changed

3 files changed

+45
-10
lines changed

package-lock.json

Lines changed: 34 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@
3838
"dependencies": {
3939
"@toruslabs/constants": "^14.0.0",
4040
"@toruslabs/http-helpers": "^7.0.0",
41-
"@toruslabs/session-manager": "^3.0.0",
41+
"@toruslabs/session-manager": "^3.1.0",
4242
"@web3auth/auth": "^9.4.0",
4343
"buffer": "^6.0.3",
4444
"lodash.clonedeep": "^4.5.0",
4545
"lodash.merge": "^4.6.2",
4646
"loglevel": "^1.9.2",
47-
"react-native-url-polyfill": "^2.0.0"
47+
"react-native-url-polyfill": "^2.0.0",
48+
"urijs": "^1.19.11"
4849
},
4950
"peerDependencies": {
5051
"@babel/runtime": "^7.x",
@@ -59,6 +60,7 @@
5960
"@types/lodash.merge": "^4.6.9",
6061
"@types/node": "^20",
6162
"@types/react-native": "^0.72.8",
63+
"@types/urijs": "^1.19.25",
6264
"eslint": "^8.53.0",
6365
"husky": "^9.1.6",
6466
"lint-staged": "^15.2.10",
@@ -71,4 +73,4 @@
7173
"node": ">=18.x",
7274
"npm": ">=9.x"
7375
}
74-
}
76+
}

src/Web3Auth.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
import clonedeep from "lodash.clonedeep";
1313
import merge from "lodash.merge";
1414
import log from "loglevel";
15+
import URI from "urijs";
1516

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

466467
private async authorizeSession(): Promise<AuthSessionData> {
467468
try {
468-
const data = await this.sessionManager.authorizeSession();
469+
const data = await this.sessionManager.authorizeSession({
470+
headers: {
471+
Origin: new URI(this.options.redirectUrl).origin(),
472+
},
473+
});
469474
return data;
470475
} catch (error: unknown) {
471476
return {};

0 commit comments

Comments
 (0)