v0.5.155: src/auth.js переведён на v2/config IAM_API_BASE

This commit is contained in:
2026-06-17 14:44:04 +04:00
parent fb17c83e60
commit d72bb84d25
2 changed files with 5 additions and 4 deletions
+4 -3
View File
@@ -25,7 +25,8 @@ const jwt = require('jsonwebtoken');
const crypto = require('crypto');
const https = require('https');
const http = require('http');
const { IAM_API_URL } = require('./config');
const { iamApiBase } = require('../v2/src/config');
const IAM_API_URL = iamApiBase;
// ── Конфигурация из окружения ────────────────────────────────────────────────
const ISSUER = process.env.JWT_ISSUER || 'mock-auth-api';
@@ -286,7 +287,7 @@ function verifyAnyToken(token, devMode) {
*/
async function fetchIamUser(token) {
const raw = await new Promise((resolve, reject) => {
const url = new URL(IAM_API_URL + '/api/v1/auth/user');
const url = new URL(IAM_API_URL + '/auth/user');
const lib = url.protocol === 'https:' ? https : http;
const req = lib.request({
hostname: url.hostname,
@@ -343,7 +344,7 @@ async function fetchIamUser(token) {
async function switchProfile(token, profileId) {
const body = JSON.stringify({ profile_id: profileId });
const raw = await new Promise((resolve, reject) => {
const url = new URL(IAM_API_URL + '/api/v1/user/switch-profile');
const url = new URL(IAM_API_URL + '/user/switch-profile');
const lib = url.protocol === 'https:' ? https : http;
const req = lib.request({
hostname: url.hostname,