mirror of
https://github.com/decolua/9router.git
synced 2026-05-08 12:01:28 +00:00
fix(api): improve access token handling during credential refresh
This commit is contained in:
@@ -1270,7 +1270,7 @@ Full architecture reference: [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md)
|
||||
|
||||
Thanks to all contributors who helped make 9Router better!
|
||||
|
||||
[](https://github.com/decolua/9router/graphs/contributors)
|
||||
[](https://github.com/decolua/9router/graphs/contributors)
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ async function refreshAndUpdateCredentials(connection) {
|
||||
const refreshResult = await executor.refreshCredentials(credentials, console);
|
||||
|
||||
if (!refreshResult) {
|
||||
// For GitHub, if refreshCredentials fails but we still have accessToken, try to use it directly
|
||||
if (connection.provider === "github" && connection.accessToken) {
|
||||
// Refresh failed but we still have an accessToken — try with existing token
|
||||
if (connection.accessToken) {
|
||||
return { connection, refreshed: false };
|
||||
}
|
||||
throw new Error("Failed to refresh credentials. Please re-authorize the connection.");
|
||||
|
||||
Reference in New Issue
Block a user