fix(api): improve access token handling during credential refresh

This commit is contained in:
decolua
2026-03-10 16:37:55 +07:00
parent 31775393e6
commit a501c05969
2 changed files with 3 additions and 3 deletions

View File

@@ -1270,7 +1270,7 @@ Full architecture reference: [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md)
Thanks to all contributors who helped make 9Router better!
[![Contributors](https://contrib.rocks/image?repo=decolua/9router&max=150&columns=15&anon=1)](https://github.com/decolua/9router/graphs/contributors)
[![Contributors](https://contrib.rocks/image?repo=decolua/9router&max=150&columns=15&anon=1&v=20260309)](https://github.com/decolua/9router/graphs/contributors)
---

View File

@@ -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.");