bump 0.5.29 — add KC_BASE_URL to exchange error
This commit is contained in:
+3
-1
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user