mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-02 13:22:11 +03:00
Integrated into release/v3.7.0. Thank you for the contribution @trader-payne!
This commit is contained in:
@@ -148,6 +148,10 @@ export async function executeChatWithBreaker({
|
||||
expiresIn: newCreds.expiresIn,
|
||||
expiresAt: newCreds.expiresAt,
|
||||
providerSpecificData: newCreds.providerSpecificData,
|
||||
// Cookie/session providers (chatgpt-web) rotate the stored
|
||||
// apiKey blob mid-request — forward it so the DB credential
|
||||
// doesn't go stale after Set-Cookie rotation.
|
||||
apiKey: newCreds.apiKey,
|
||||
testStatus: "active",
|
||||
});
|
||||
},
|
||||
|
||||
@@ -106,6 +106,15 @@ export async function updateProviderCredentials(connectionId: string, newCredent
|
||||
if (newCredentials.providerSpecificData) {
|
||||
updates.providerSpecificData = newCredentials.providerSpecificData;
|
||||
}
|
||||
// Cookie/session providers (chatgpt-web, ...) refresh by rotating the
|
||||
// stored apiKey blob — propagate that here too so DB credentials don't
|
||||
// go stale after Set-Cookie rotation.
|
||||
if (newCredentials.apiKey) {
|
||||
updates.apiKey = newCredentials.apiKey;
|
||||
}
|
||||
if (newCredentials.testStatus) {
|
||||
updates.testStatus = newCredentials.testStatus;
|
||||
}
|
||||
|
||||
const result = await updateProviderConnection(connectionId, updates);
|
||||
log.info("TOKEN_REFRESH", "Credentials updated in localDb", {
|
||||
|
||||
Reference in New Issue
Block a user