v2: откат auth/config/server к 5c09844 — чистый модуль аутентификации
This commit is contained in:
+1
-10
@@ -8,7 +8,6 @@
|
||||
const express = require('express');
|
||||
const config = require('./src/config');
|
||||
const auth = require('./src/auth');
|
||||
const crud = require('./src/crud');
|
||||
|
||||
const oidcConfig = {
|
||||
baseUrl: config.kcBaseUrl,
|
||||
@@ -22,11 +21,6 @@ const oidcConfig = {
|
||||
* Сессия используется общая, но ключи — с префиксом v2_ чтобы не пересекаться.
|
||||
*/
|
||||
function createV2Router() {
|
||||
// Автосоздание таблиц при первом обращении
|
||||
const { pool } = require('./src/db');
|
||||
const { ensureSchema } = require('./src/db/schema');
|
||||
ensureSchema(pool).catch(e => console.error('[v2:db] Schema error:', e.message));
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
// ── GET /v2/ — главная (вывод IAM-данных) ───────────────────────────────
|
||||
@@ -46,7 +40,7 @@ function createV2Router() {
|
||||
.logout { color: #ef5350; }
|
||||
.label { color: #888; }
|
||||
</style></head><body>
|
||||
<h2>✅ Вход выполнен <small style="color:#888">v${config.version}</small></h2>
|
||||
<h2>✅ Вход выполнен</h2>
|
||||
<p><span class="label">Email:</span> ${u.email}</p>
|
||||
<p><span class="label">clientId:</span> ${u.clientId} <span class="label">(активная компания)</span></p>
|
||||
<p><span class="label">Компания:</span> ${u.companyName}</p>
|
||||
@@ -108,9 +102,6 @@ ${u.isImpersonated ? `<p style="background:#ffc107;color:#000;padding:5px;">⚠
|
||||
}
|
||||
});
|
||||
|
||||
// ── CRUD (/v2/app) ────────────────────────────────────────────
|
||||
router.use('/app', crud.createCrudRouter());
|
||||
|
||||
// ── GET /v2/logout ───────────────────────────────────────────────────────
|
||||
router.get('/logout', (req, res) => {
|
||||
delete req.session.v2_user;
|
||||
|
||||
Reference in New Issue
Block a user