@turnkey/sdk-react 5.0.1 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -100,10 +100,6 @@ const Auth = ({
100
100
  React.useEffect(() => {
101
101
  const manageClient = async () => {
102
102
  if (indexedDbClient && turnkey$1) {
103
- const session = await turnkey$1.getSession();
104
- if (!session) {
105
- await indexedDbClient.resetKeyPair();
106
- }
107
103
  const retrievedPublicKey = await indexedDbClient.getPublicKey();
108
104
  if (retrievedPublicKey) {
109
105
  setComponentReady(true);
@@ -175,6 +171,7 @@ const Auth = ({
175
171
  constants.authErrors.passkey.createFailed;
176
172
  }
177
173
  }
174
+ await indexedDbClient.resetKeyPair();
178
175
  const pubKey = await indexedDbClient.getPublicKey();
179
176
  await passkeyClient?.loginWithPasskey({
180
177
  sessionType: exports.SessionType.READ_WRITE,
@@ -190,6 +187,7 @@ const Auth = ({
190
187
  const handleLoginWithPasskey = async () => {
191
188
  try {
192
189
  setLoading("passkey");
190
+ await indexedDbClient?.resetKeyPair();
193
191
  const pubKey = await indexedDbClient.getPublicKey();
194
192
  await passkeyClient?.loginWithPasskey({
195
193
  sessionType: exports.SessionType.READ_WRITE,
@@ -299,6 +297,7 @@ const Auth = ({
299
297
  onError(constants.authErrors.wallet.loginFailed);
300
298
  return;
301
299
  }
300
+ await indexedDbClient.resetKeyPair();
302
301
  const pubKey = await indexedDbClient.getPublicKey();
303
302
  await walletClient.loginWithWallet({
304
303
  sessionType: exports.SessionType.READ_WRITE,