fix(web): remove identity simulation and stop sending X-User-ID

Product UI no longer switches sessions locally; API clients attach Bearer
tokens only and LocalAuthClient stays test-only outside the prod bundle.
This commit is contained in:
weichen
2026-09-13 02:50:22 +00:00
committed by weichen
parent 886cbb7913
commit d612c1193e
14 changed files with 259 additions and 543 deletions
+2 -4
View File
@@ -1,8 +1,6 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import {
createInMemoryAuthClient,
} from './auth';
import { createInMemoryAuthClient } from './auth.local';
test('AuthClient: 基础登录与 .env 超级管理员鉴权', async () => {
const client = createInMemoryAuthClient({
@@ -23,7 +21,7 @@ test('AuthClient: 基础登录与 .env 超级管理员鉴权', async () => {
const session = await client.login({ username: 'admin', password: 'admin-password-123' });
assert.equal(session.user.username, 'admin');
assert.equal(session.user.roleId, 'role-admin');
assert.equal(session.allowDevSwitch, true);
assert.equal(session.env, 'dev');
assert.ok(session.token.length > 0);
});