feat(sub): allow identity tokens on every subscription link (#5935)

Keep usage tokens first-link-only while adding an opt-in setting for repeating EMAIL and USERNAME in subscription-body remarks.

Co-authored-by: x06579 <x06579@ai-dashboard>
This commit is contained in:
H-TTTTTandx06579 authored and GitHub committed 2026-07-28 22:12:52 +02:00 Unverified
1 parent 8bbca76bdd
commit 8f49327efb
29 files changed
+190 -9

No files matched your search

@@ -0,0 +1,22 @@
import { describe, it, expect } from 'vitest';
import { AllSettingSchema } from '@/schemas/setting';
import { AllSetting } from '@/models/setting';
describe('subShowIdentityOnAllLinks', () => {
it('defaults to false on AllSetting', () => {
expect(new AllSetting().subShowIdentityOnAllLinks).toBe(false);
});
it('accepts boolean values in the settings schema', () => {
for (const v of [true, false]) {
const r = AllSettingSchema.safeParse({ subShowIdentityOnAllLinks: v });
expect(r.success, `subShowIdentityOnAllLinks=${v}`).toBe(true);
}
});
it('rejects non-boolean values', () => {
for (const v of ['true', 1, null]) {
expect(AllSettingSchema.safeParse({ subShowIdentityOnAllLinks: v }).success).toBe(false);
}
});
});