v0.5.145: /v2/iam_response через mainAuth.fetchIamUser

This commit is contained in:
“Naeel”
2026-06-16 13:21:13 +04:00
parent e41ecc08be
commit 7042767e53
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "ipwhitelist", "name": "ipwhitelist",
"version": "0.5.144", "version": "0.5.145",
"description": "IP WhiteList microservice for cloud provider", "description": "IP WhiteList microservice for cloud provider",
"main": "server.js", "main": "server.js",
"scripts": { "scripts": {
+2 -1
View File
@@ -55,7 +55,8 @@ function createV2Router() {
const token = req.session && req.session.token; const token = req.session && req.session.token;
if (!token) return res.send('<h2>Нет токена</h2><p><a href="/v2/login">Войти</a></p>'); if (!token) return res.send('<h2>Нет токена</h2><p><a href="/v2/login">Войти</a></p>');
try { try {
const iamData = await auth.fetchIamUser(token); const mainAuth = require('../src/auth');
const iamData = await mainAuth.fetchIamUser(token);
res.set('Content-Type', 'text/html; charset=utf-8'); res.set('Content-Type', 'text/html; charset=utf-8');
res.send('<!DOCTYPE html>\n<html><head><meta charset="utf-8"><title>IAM Raw</title>' res.send('<!DOCTYPE html>\n<html><head><meta charset="utf-8"><title>IAM Raw</title>'
+ '<style>body{font-family:monospace;background:#111;color:#eee;padding:20px}' + '<style>body{font-family:monospace;background:#111;color:#eee;padding:20px}'