From 6ce6b0425c9cfa03e43aaf2d106223dcaa854ef8 Mon Sep 17 00:00:00 2001 From: dfahlander Date: Wed, 14 Feb 2024 22:28:51 +0100 Subject: [PATCH] Bugfix: No sync after token expires due to missing refresh token in OTP flow. Bug was introduced in dexie-cloud-addon@4.0.1-beta. Many thanks to @dusty-phillips for finding the bug and pin-pointing the commit that introduced it. --- addons/dexie-cloud/package.json | 2 +- addons/dexie-cloud/src/authentication/otpFetchTokenCallback.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/dexie-cloud/package.json b/addons/dexie-cloud/package.json index 0fa303ba6..e089a8ff0 100644 --- a/addons/dexie-cloud/package.json +++ b/addons/dexie-cloud/package.json @@ -1,6 +1,6 @@ { "name": "dexie-cloud-addon", - "version": "4.0.1-beta.56", + "version": "4.0.1-beta.57", "description": "Dexie addon that syncs with to Dexie Cloud", "main": "dist/umd/dexie-cloud-addon.js", "type": "module", diff --git a/addons/dexie-cloud/src/authentication/otpFetchTokenCallback.ts b/addons/dexie-cloud/src/authentication/otpFetchTokenCallback.ts index 569d0d88e..86747e274 100644 --- a/addons/dexie-cloud/src/authentication/otpFetchTokenCallback.ts +++ b/addons/dexie-cloud/src/authentication/otpFetchTokenCallback.ts @@ -82,6 +82,7 @@ export function otpFetchTokenCallback(db: DexieCloudDB): FetchTokenCallback { ...tokenRequest, otp: otp || '', otp_id: response.otp_id, + public_key } satisfies OTPTokenRequest2; let res2 = await fetch(`${url}/token`, {