refactor(auth): address server review feedback
- Extract auth DTOs, cookie/JWT helpers and the generic duration parser. - Configure the session cookie and map domain auth failures to HTTP responses. - Add typed Swagger responses and focused regression coverage.
This commit is contained in:
1 parent
72e127888c
commit
1830feb71b
18 files changed
+399
-208
No files matched your search
@@ -1,9 +1,22 @@
|
||||
import { INestApplication } from "@nestjs/common";
|
||||
import request from "supertest";
|
||||
import { appPackage } from "../src/common/app-package";
|
||||
import { ManifestDto } from "../src/manifest/manifest.dto";
|
||||
import { buildTestApp } from "./app.harness";
|
||||
|
||||
describe("GET /manifest.json", () => {
|
||||
it("describes the manifest auth flag without describing authentication as optional", () => {
|
||||
const authProperty = Reflect.getMetadata(
|
||||
"swagger/apiModelProperties",
|
||||
ManifestDto.prototype,
|
||||
"auth",
|
||||
) as { description: string };
|
||||
expect(authProperty.description).toBe(
|
||||
"Whether account authentication is enabled.",
|
||||
);
|
||||
expect(authProperty.description).not.toContain("optional");
|
||||
});
|
||||
|
||||
let app: INestApplication;
|
||||
|
||||
afterEach(async () => {
|
||||
|
||||
Reference in new issue
Block a user