fix(auth): use public URL for magic-link redirects
CI / validate (push) Successful in 4m53s
Release / release (push) Successful in 6m30s

This commit is contained in:
dmg
2026-08-01 16:44:01 -04:00
parent 9440c651b6
commit 5e693e2cdd
5 changed files with 21 additions and 3 deletions
+9
View File
@@ -0,0 +1,9 @@
import { describe, expect, it } from "vitest";
import { applicationUrl } from "./application-url";
describe("applicationUrl", () => {
it("builds browser redirects from the configured public application URL", () => {
expect(applicationUrl("/welcome", "https://portal.somc.club"))
.toEqual(new URL("https://portal.somc.club/welcome"));
});
});
+4
View File
@@ -0,0 +1,4 @@
export function applicationUrl(path: string, baseUrl = process.env.APP_URL) {
if (!baseUrl) throw new Error("APP_URL is required to build public application URLs");
return new URL(path, baseUrl);
}