bump 0.5.29 — add KC_BASE_URL to exchange error

This commit is contained in:
2026-06-09 21:56:45 +04:00
parent 6c5215513c
commit a39f97f3b4
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -48,7 +48,9 @@ function createRouter({ auth, doubleCsrfProtection, generateCsrfToken, authLimit
try {
// Обмен code на токен (через IAM / Keycloak)
const tokenData = await auth.exchangeCode(code);
const tokenData = await auth.exchangeCode(code).catch(e => {
throw new Error('Code exchange failed: ' + (e.message || e) + ' [KC_BASE_URL=' + process.env.KC_BASE_URL + ', code=' + (code || '').slice(0, 8) + '...]');
});
const accessToken = tokenData.accessToken;
if (!accessToken) throw new Error('No access_token in response');