Skip to content

Commit 45ee08f

Browse files
committed
openlogin session manager integrated
1 parent 10c9e8e commit 45ee08f

File tree

14 files changed

+10905
-10447
lines changed

14 files changed

+10905
-10447
lines changed

.vscode/launch.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Attach to Hermes application - Experimental",
5+
"request": "attach",
6+
"type": "reactnativedirect",
7+
"cwd": "${workspaceFolder}"
8+
},
9+
{
10+
"name": "Debug Android Hermes - Experimental",
11+
"request": "launch",
12+
"type": "reactnativedirect",
13+
"cwd": "${workspaceFolder}/rn-bare-example",
14+
"platform": "android"
15+
},
16+
{
17+
"name": "Debug iOS Hermes - Experimental",
18+
"request": "launch",
19+
"type": "reactnativedirect",
20+
"cwd": "${workspaceFolder}/rn-bare-example",
21+
"platform": "ios"
22+
}
23+
]
24+
}

package-lock.json

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

package.json

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3auth/react-native-sdk",
3-
"version": "3.5.0",
3+
"version": "3.5.1",
44
"description": "Web3Auth SDK that supports Bare (Standalone) and Expo React Native apps.",
55
"main": "dist/reactNativeSdk.cjs.js",
66
"module": "dist/reactNativeSdk.esm.js",
@@ -22,7 +22,7 @@
2222
"type": "git",
2323
"url": "git+https://github.com/web3auth/web3auth-react-native-sdk.git"
2424
},
25-
"author": "michaellee8",
25+
"author": "Web3Auth",
2626
"license": "MIT",
2727
"bugs": {
2828
"url": "https://github.com/web3auth/web3auth-react-native-sdk/issues"
@@ -36,41 +36,38 @@
3636
"web3auth"
3737
],
3838
"dependencies": {
39-
"@toruslabs/eccrypto": "^1.1.8",
40-
"@toruslabs/metadata-helpers": "^3.1.0",
39+
"@toruslabs/openlogin-session-manager": "^1.0.0",
4140
"base64url": "^3.0.1",
4241
"buffer": "^6.0.3",
4342
"loglevel": "^1.8.1",
4443
"react-native-url-polyfill": "^1.3.0"
4544
},
4645
"peerDependencies": {
4746
"@babel/runtime": "^7.x",
48-
"crypto-browserify": "^3.12.0",
49-
"react-native": "*",
50-
"stream-browserify": "^3.0.0"
47+
"react-native": "*"
5148
},
5249
"devDependencies": {
53-
"@babel/runtime": "^7.21.0",
54-
"@toruslabs/eslint-config-typescript": "1.4.1",
55-
"@toruslabs/openlogin": "^3.2.1",
56-
"@toruslabs/torus-scripts": "^3.0.4",
50+
"@babel/runtime": "^7.21.5",
51+
"@toruslabs/eslint-config-typescript": "2.0.0",
52+
"@toruslabs/openlogin-utils": "^4.2.0",
53+
"@toruslabs/torus-scripts": "^4.0.0",
5754
"@types/node": "^18",
58-
"@types/react-native": "^0.71.3",
59-
"@typescript-eslint/eslint-plugin": "^5.55.0",
60-
"@typescript-eslint/parser": "^5.55.0",
61-
"eslint": "^8.36.0",
55+
"@types/react-native": "^0.71.6",
56+
"@typescript-eslint/eslint-plugin": "^5.59.2",
57+
"@typescript-eslint/parser": "^5.59.2",
58+
"eslint": "^8.39.0",
6259
"eslint-plugin-import": "^2.27.5",
6360
"eslint-plugin-mocha": "^10.1.0",
64-
"eslint-plugin-n": "^15.6.1",
61+
"eslint-plugin-n": "^15.7.0",
6562
"eslint-plugin-prettier": "^4.2.1",
6663
"eslint-plugin-promise": "^6.1.1",
6764
"eslint-plugin-simple-import-sort": "^10.0.0",
6865
"eslint-plugin-tsdoc": "^0.2.17",
6966
"husky": "^8.0.3",
70-
"lint-staged": "^13.2.0",
71-
"prettier": "^2.8.4",
72-
"react-native": "~0.68.2",
73-
"rimraf": "^4.4.0",
67+
"lint-staged": "^13.2.2",
68+
"prettier": "^2.8.8",
69+
"react-native": "~0.71.7",
70+
"rimraf": "^5.0.0",
7471
"typescript": "^4.9.5"
7572
}
7673
}

rn-bare-example/App.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ export default function App() {
3636
}
3737

3838
setConsole('Logging in');
39-
const result = await web3auth.login({
39+
await web3auth.login({
4040
loginProvider: LOGIN_PROVIDER.GOOGLE,
4141
redirectUrl: resolvedRedirectUrl,
4242
mfaLevel: 'default',
4343
curve: 'secp256k1',
4444
});
4545

46-
if (result) {
47-
setUserInfo(web3auth.userInfo);
46+
if (web3auth.privKey) {
47+
setUserInfo(web3auth.userInfo());
4848
setKey(web3auth.privKey);
4949
uiConsole('Logged In');
5050
}
@@ -60,9 +60,9 @@ export default function App() {
6060
}
6161

6262
setConsole('Logging out');
63-
const result = await web3auth.logout();
63+
await web3auth.logout();
6464

65-
if (result) {
65+
if (!web3auth.privKey) {
6666
setUserInfo(undefined);
6767
setKey('');
6868
uiConsole('Logged out');
@@ -85,12 +85,11 @@ export default function App() {
8585
},
8686
},
8787
});
88-
8988
setWeb3Auth(auth);
90-
const result = await auth.init();
91-
if (result) {
89+
await auth.init();
90+
if (auth?.privKey) {
9291
uiConsole('Re logged in');
93-
setUserInfo(auth.userInfo);
92+
setUserInfo(auth.userInfo());
9493
setKey(auth.privKey);
9594
window.console.log(auth.privKey);
9695
}

rn-bare-example/ethersRPC.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {ethers} from 'ethers';
2+
import '@ethersproject/shims';
23

34
const providerUrl = 'https://rpc.ankr.com/eth'; // Or your desired provider url
45

rn-bare-example/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import {AppRegistry} from 'react-native';
66
import './globals';
7-
import '@ethersproject/shims';
87
import App from './App';
98
import {name as appName} from './app.json';
109

0 commit comments

Comments
 (0)