v0.5.150: IAM_API_URL dev→prod, confirm logout

This commit is contained in:
2026-06-17 11:10:52 +04:00
parent 710dcfc7c9
commit 24fb8cdc56
3 changed files with 21 additions and 3 deletions
+19 -1
View File
@@ -146,7 +146,25 @@ function createV2Router() {
router.use('/export', createExportRouter());
// ── GET /v2/logout — редирект на основной выход ─────────────────────
router.get('/logout', (req, res) => res.redirect('/logout'));
router.get('/logout', (req, res) => {
const ua = (req.headers['user-agent'] || '').toLowerCase();
const isBrowser = ua.includes('mozilla') || ua.includes('chrome') || ua.includes('safari');
if (isBrowser) {
res.set('Content-Type', 'text/html; charset=utf-8');
return res.send('<!DOCTYPE html><html><head><meta charset="utf-8"><title>Выход</title>'
+ '<style>body{font-family:sans-serif;background:#111;color:#eee;padding:40px;text-align:center}'
+ 'h2{color:#4fc3f7}p{font-size:16px;margin:20px 0}'
+ '.btn{display:inline-block;padding:12px 24px;margin:0 10px;border-radius:6px;text-decoration:none;font-size:16px}'
+ '.btn-yes{background:#ef5350;color:#fff}.btn-no{background:#333;color:#eee}'
+ '</style></head><body>'
+ '<h2>Выход из приложения</h2>'
+ '<p>Выход завершит сессию во всех сервисах Nubes (Keycloak SSO).<br>Вы уверены?</p>'
+ '<a href="/logout" class="btn btn-yes">Да, выйти</a>'
+ '<a href="/v2/app" class="btn btn-no">Отмена</a>'
+ '</body></html>');
}
res.redirect('/logout');
});
return router;
}