feat(ui): improve full mobile browser support
Deploy / Build (push) Successful in 26s
Deploy / Test & Lint (push) Successful in 31s
Deploy / Build and Push Docker Image (push) Successful in 1m52s

Implements responsive mobile layout improvements and host-only cookies for direct IP deployments.

Co-authored-by: luna <clawy@reversed.dev>
Co-committed-by: luna <clawy@reversed.dev>
This commit was merged in pull request #3.
This commit is contained in:
2026-07-22 22:51:37 +02:00
committed by Luna
parent b95811a4e5
commit 7d891f3ec5
15 changed files with 90 additions and 63 deletions
+5 -2
View File
@@ -70,8 +70,11 @@ export function normalizeUsername(username: string): string {
}
/** Compute the cookie domain scope from the configured DOMAIN. */
export function cookieDomain(domain: string): string {
if (domain === "localhost") return "localhost";
export function cookieDomain(domain: string): string | undefined {
// IP addresses cannot have a registrable parent domain. Treating the first
// octet as a subdomain would turn 100.74.255.106 into 74.255.106 and make
// browser sessions unusable on direct-IP test/self-hosted deployments.
if (domain === "localhost" || /^(?:\d{1,3}\.){3}\d{1,3}$/.test(domain)) return undefined;
if (domain.split(".").length > 2) {
// Subdomain deployment: scope to the registrable parent domain.
return domain.split(".").slice(1).join(".");
+2 -1
View File
@@ -16,10 +16,11 @@ import { createLogger } from "../../lib/logger";
const log = createLogger("auth");
function setSessionCookie(ctr: any, hash: string) {
const domain = cookieDomain(DOMAIN);
ctr.cookies.set(
SESSION_COOKIE,
new Cookie(hash, {
domain: cookieDomain(DOMAIN),
...(domain ? { domain } : {}),
httpOnly: true,
path: "/",
sameSite: "lax",