@autional/shared 0.1.0-rc.49 → 0.1.0-rc.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autional/shared",
3
- "version": "0.1.0-rc.49",
3
+ "version": "0.1.0-rc.50",
4
4
  "description": "Autional shared layer — API client, auth, types, hooks, utils",
5
5
  "license": "AGPL-3.0",
6
6
  "main": "./src/index.ts",
@@ -123,6 +123,18 @@ describe('buildLoginUrl', () => {
123
123
  );
124
124
  });
125
125
 
126
+ // 回归锁(2026-11-08):/activity 与 /security 是 auth 站裸路由,
127
+ // 缺登记会被当成租户 slug → /activity/login、/security/login(未知租户页)。
128
+ it('treats /activity and /security as reserved auth routes', () => {
129
+ for (const route of ['activity', 'security']) {
130
+ mockWindow('auth.autional.local', 'https:', 'https://auth.autional.local', AUTH_CONFIG);
131
+ const target = `https://auth.autional.local/${route}`;
132
+ expect(buildLoginUrl(target)).toBe(
133
+ 'https://auth.autional.local?redirect=' + encodeURIComponent(target),
134
+ );
135
+ }
136
+ });
137
+
126
138
  it('preserves cross-domain returnUrl behavior (app domain)', () => {
127
139
  mockWindow('auth.autional.local', 'https:', 'https://auth.autional.local', AUTH_CONFIG);
128
140
  const url = buildLoginUrl('https://app.autional.com/admin');
package/src/auth/roles.ts CHANGED
@@ -36,6 +36,10 @@ const AUTH_ROUTE_RESERVED = new Set([
36
36
  'recover-account',
37
37
  'account-deletion',
38
38
  'verify-identity',
39
+ // auth 站裸路由:/activity(活动页,原 /security 改名)与 /security(旧路径重定向)。
40
+ // 缺这两段会把首段当租户 slug,生成 /activity/login、/security/login(未知租户页)。
41
+ 'activity',
42
+ 'security',
39
43
  ]);
40
44
 
41
45
  /**