Skip to content

Commit bb92b36

Browse files
authored
[SID-1542] React SDK: Trigger a render after performing MFA (#215)
* Trigger a render after performing MFA * Use beta versions to fix the build until the core SDK is published * Temporarily downgrade the peer dep requirement on the core SDK * Update to the latest core SDK * Update the lockfile
1 parent 3a32b70 commit bb92b36

File tree

6 files changed

+828
-18
lines changed

6 files changed

+828
-18
lines changed

.changeset/shy-poems-shop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@slashid/react": patch
3+
---
4+
5+
Trigger a render after performing MFA

packages/react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
},
6666
"devDependencies": {
6767
"@faker-js/faker": "^8.0.2",
68-
"@slashid/slashid": "3.18.0",
68+
"@slashid/slashid": "3.18.2",
6969
"@storybook/addon-essentials": "7.0.0-rc.2",
7070
"@storybook/addon-interactions": "7.4.0",
7171
"@storybook/addon-links": "7.4.0",
@@ -100,7 +100,7 @@
100100
"yalc": "1.0.0-pre.53"
101101
},
102102
"peerDependencies": {
103-
"@slashid/slashid": ">= 3.18.0",
103+
"@slashid/slashid": ">= 3.18.2",
104104
"react": ">=16",
105105
"react-dom": ">=16"
106106
}

packages/react/src/context/slash-id-context.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,11 @@ export const SlashIDProvider = ({
200200
}
201201

202202
await user.mfa(handle, factor);
203-
return user;
203+
const userAfterMfa = new User(user.toString(), sidRef.current!);
204+
storeUser(userAfterMfa);
205+
return userAfterMfa;
204206
},
205-
[user, state]
207+
[state, user, storeUser]
206208
);
207209

208210
/**

packages/react/src/dev.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ root.render(
293293
<SlashIDProvider
294294
oid={import.meta.env.VITE_ORG_ID}
295295
themeProps={{ theme: "dark" }}
296-
baseApiUrl="https://slashid.local"
297-
sdkUrl="https://jump.slashid.local/sdk.html"
296+
baseApiUrl="https://api.slashid.com"
297+
sdkUrl="https://cdn.slashid.com/sdk.html"
298298
tokenStorage="memory"
299299
analyticsEnabled
300300
>

packages/remix/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"main": "dist/main.js",
1010
"module": "dist/main.js",
1111
"dependencies": {
12-
"@slashid/react": "^1.18.0",
13-
"@slashid/slashid": "3.18.0",
12+
"@slashid/react": "1.18.1-beta.0",
13+
"@slashid/slashid": "3.18.2",
1414
"jose": "^5.2.0",
1515
"url-join": "^5.0.0"
1616
},

0 commit comments

Comments
 (0)