Skip to content

A local-first personal finance app

Fix OpenID token expiration to correctly use seconds from config (#6130)

Digvijay Singhd0f02c7272d6
diff --git a/packages/sync-server/src/accounts/openid.js b/packages/sync-server/src/accounts/openid.js
index 99d63ed8cc..bc039ea4e5 100644
--- a/packages/sync-server/src/accounts/openid.js
+++ b/packages/sync-server/src/accounts/openid.js
@@ -312,9 +312,9 @@ export async function loginWithOpenIdFinalize(body) {
expiration = TOKEN_EXPIRATION_NEVER;
} else if (typeof config.get('token_expiration') === 'number') {
expiration =
- Math.floor(Date.now() / 1000) + config.get('token_expiration') * 60;
+ Math.floor(Date.now() / 1000) + config.get('token_expiration');
} else {
- expiration = Math.floor(Date.now() / 1000) + 10 * 60;
+ expiration = Math.floor(Date.now() / 1000) + 10 * 60; // Default to 10 minutes
}
accountDb.mutate(
diff --git a/upcoming-release-notes/6130.md b/upcoming-release-notes/6130.md
new file mode 100644
index 0000000000..471272fdf7
--- /dev/null
+++ b/upcoming-release-notes/6130.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [dnitros]
+---
+
+Fix OpenID token expiration to correctly use seconds from config