@fudrouter/fsrouter 0.6.88 → 0.6.90

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.
@@ -98,14 +98,17 @@ export async function createProviderConnection(data) {
98
98
  const all = db.all(`SELECT * FROM providerConnections WHERE provider = ?`, [data.provider]).map(rowToConn);
99
99
 
100
100
  let existing = null;
101
- if (data.authType === "oauth" && data.email) {
102
- const incomingWs = data.providerSpecificData?.chatgptAccountId;
101
+ if (data.authType === "oauth" || data.authType === "access_token") {
102
+ // Dedupe only when the access token is identical — allows multiple
103
+ // accounts (different tokens, even same email) for device-code/OAuth
104
+ // providers like Nous, GitHub, etc.
105
+ const incomingToken = data.accessToken;
103
106
  existing = all.find(c => {
104
- if (c.authType !== "oauth" || c.email !== data.email) return false;
105
- // If both sides have a workspace ID, they must match for dedup
106
- const existingWs = c.providerSpecificData?.chatgptAccountId;
107
- if (incomingWs && existingWs) return incomingWs === existingWs;
108
- return true; // fallback: email-only match for non-workspace providers
107
+ if (c.authType !== data.authType) return false;
108
+ if (incomingToken && c.accessToken === incomingToken) return true;
109
+ // Fallback: email-only match only when no token is available yet
110
+ if (!incomingToken && data.email && c.email === data.email) return true;
111
+ return false;
109
112
  });
110
113
  } else if (data.authType === "apikey" && data.name) {
111
114
  existing = all.find(c => c.authType === "apikey" && c.name === data.name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fudrouter/fsrouter",
3
- "version": "0.6.88",
3
+ "version": "0.6.90",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "9Router v2 — Express Backend (API, SSE, DB, Auth, MITM)",
package/public/index.html CHANGED
@@ -10,10 +10,10 @@
10
10
  <link rel="preconnect" href="https://fonts.googleapis.com" />
11
11
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
12
12
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
13
- <script type="module" crossorigin src="/assets/index.CemlR_k0.js?v=088"></script>
14
- <link rel="modulepreload" crossorigin href="/assets/router.Cjj1--8t.js?v=088">
15
- <link rel="modulepreload" crossorigin href="/assets/zustand.akaTi5uX.js?v=088">
16
- <link rel="stylesheet" crossorigin href="/assets/index.COMgQZYj.css?v=088">
13
+ <script type="module" crossorigin src="/assets/index.CemlR_k0.js?v=088?v=089?v=090"></script>
14
+ <link rel="modulepreload" crossorigin href="/assets/router.Cjj1--8t.js?v=088?v=089?v=090">
15
+ <link rel="modulepreload" crossorigin href="/assets/zustand.akaTi5uX.js?v=088?v=089?v=090">
16
+ <link rel="stylesheet" crossorigin href="/assets/index.COMgQZYj.css?v=088?v=089?v=090">
17
17
  </head>
18
18
  <body>
19
19
  <div id="root"></div>