Improvements: remove dead config, fix ESM, add URL validation, unify types, add missing logging
- Remove .prettierrc (dead config, Biome replaces Prettier) - Rename lighthouserc.json to lighthouserc.cjs with module.exports for ESM compat - Add logger.warn to empty catch blocks in auth, register, site-settings, prisma-cache, redis, security, rate-limit - Unify ActionResult type: action-helper.ts uses 'ok' consistent with safe-action-shared.ts - Add noUnusedLocals + noUnusedParameters to tsconfig + fix 25 pre-existing unused vars - Replace barrel export src/types/index.ts with direct @/types/common imports - Make trustHost conditional (development only) in auth.ts - Add pre-flight URL validation to update-Nitrov3.sh to catch image.library.url misconfigurations - Improve NITRO_IMAGE_LIBRARY_URL content validation in pre-flight & post-compute checks
This commit is contained in:
1 parent
b922f6d49f
commit
17847545dd
292 files changed
+69195
-67915
No files matched your search
@@ -11,8 +11,8 @@ import { env } from "@/env";
|
||||
import { auth } from "@/lib/auth";
|
||||
import { LaravelEncrypter } from "@/lib/auth/laravel-encrypter";
|
||||
import { totpKeyUri } from "@/lib/auth/totp";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { resolveHotelName } from "@/lib/hotel-name";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
|
||||
@@ -52,26 +52,43 @@ export default async function SettingsPage() {
|
||||
<div
|
||||
className="relative overflow-hidden rounded-xl border px-5 py-4"
|
||||
style={{
|
||||
background: "color-mix(in srgb, var(--color-surface) 60%, transparent)",
|
||||
background:
|
||||
"color-mix(in srgb, var(--color-surface) 60%, transparent)",
|
||||
backdropFilter: "blur(14px)",
|
||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 8%, transparent)",
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 8%, transparent)",
|
||||
}}
|
||||
>
|
||||
<div className="flex items-center gap-3">
|
||||
<div
|
||||
className="w-10 h-10 rounded-xl flex items-center justify-center"
|
||||
style={{ background: "color-mix(in srgb, var(--color-primary) 14%, transparent)" }}
|
||||
style={{
|
||||
background:
|
||||
"color-mix(in srgb, var(--color-primary) 14%, transparent)",
|
||||
}}
|
||||
>
|
||||
<Image src="/assets/images/icons/navigation/me.png" alt="" width={22} height={22} unoptimized />
|
||||
<Image
|
||||
src="/assets/images/icons/navigation/me.png"
|
||||
alt=""
|
||||
width={22}
|
||||
height={22}
|
||||
unoptimized
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<h1
|
||||
className="text-lg font-black tracking-tight"
|
||||
style={{ color: "var(--color-text-readable)", fontFamily: "var(--font-nunito)" }}
|
||||
style={{
|
||||
color: "var(--color-text-readable)",
|
||||
fontFamily: "var(--font-nunito)",
|
||||
}}
|
||||
>
|
||||
{t("accountSettings")}
|
||||
</h1>
|
||||
<p className="text-xs" style={{ color: "var(--color-text-muted)" }}>
|
||||
<p
|
||||
className="text-xs"
|
||||
style={{ color: "var(--color-text-muted)" }}
|
||||
>
|
||||
{t("accountSettingsSubtitle")}
|
||||
</p>
|
||||
</div>
|
||||
@@ -84,17 +101,28 @@ export default async function SettingsPage() {
|
||||
<div
|
||||
className="overflow-hidden rounded-xl border card-premium"
|
||||
style={{
|
||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="flex items-center gap-2.5 px-4 py-3"
|
||||
style={{
|
||||
background: "linear-gradient(140deg, #1a3a5c 0%, #1e4a6e 20%, #2a5a80 40%, #3a6a90 60%, #4a7aa0 75%, #3a6a90 90%, #2a5a80 100%)",
|
||||
background:
|
||||
"linear-gradient(140deg, #1a3a5c 0%, #1e4a6e 20%, #2a5a80 40%, #3a6a90 60%, #4a7aa0 75%, #3a6a90 90%, #2a5a80 100%)",
|
||||
}}
|
||||
>
|
||||
<Image src="/assets/images/icons/navigation/me.png" alt="" width={18} height={18} unoptimized />
|
||||
<h2 className="text-sm font-bold text-white" style={{ fontFamily: "var(--font-nunito)" }}>
|
||||
<Image
|
||||
src="/assets/images/icons/navigation/me.png"
|
||||
alt=""
|
||||
width={18}
|
||||
height={18}
|
||||
unoptimized
|
||||
/>
|
||||
<h2
|
||||
className="text-sm font-bold text-white"
|
||||
style={{ fontFamily: "var(--font-nunito)" }}
|
||||
>
|
||||
{t("publicProfile")}
|
||||
</h2>
|
||||
</div>
|
||||
@@ -103,7 +131,13 @@ export default async function SettingsPage() {
|
||||
style={{ backgroundColor: "var(--color-surface)" }}
|
||||
>
|
||||
<div className="shrink-0">
|
||||
<div className="rounded-xl overflow-hidden border" style={{ borderColor: "color-mix(in srgb, var(--color-primary) 15%, transparent)" }}>
|
||||
<div
|
||||
className="rounded-xl overflow-hidden border"
|
||||
style={{
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-primary) 15%, transparent)",
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
src={avatar}
|
||||
alt={`${user.username} avatar`}
|
||||
@@ -115,13 +149,29 @@ export default async function SettingsPage() {
|
||||
</div>
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<h3 className="text-base font-extrabold" style={{ color: "var(--color-text-readable)" }}>
|
||||
<h3
|
||||
className="text-base font-extrabold"
|
||||
style={{ color: "var(--color-text-readable)" }}
|
||||
>
|
||||
{user.username}
|
||||
</h3>
|
||||
<p className="text-sm mt-0.5" style={{ color: "var(--color-text-muted)" }}>
|
||||
{user.motto || <span style={{ fontStyle: "italic", opacity: 0.5 }}>{t("noMotto")}</span>}
|
||||
<p
|
||||
className="text-sm mt-0.5"
|
||||
style={{ color: "var(--color-text-muted)" }}
|
||||
>
|
||||
{user.motto || (
|
||||
<span style={{ fontStyle: "italic", opacity: 0.5 }}>
|
||||
{t("noMotto")}
|
||||
</span>
|
||||
)}
|
||||
</p>
|
||||
<p className="text-xs mt-1.5 font-medium" style={{ color: "color-mix(in srgb, var(--color-text-muted) 70%, transparent)" }}>
|
||||
<p
|
||||
className="text-xs mt-1.5 font-medium"
|
||||
style={{
|
||||
color:
|
||||
"color-mix(in srgb, var(--color-text-muted) 70%, transparent)",
|
||||
}}
|
||||
>
|
||||
{user.mail || t("noEmail")}
|
||||
</p>
|
||||
</div>
|
||||
@@ -134,17 +184,28 @@ export default async function SettingsPage() {
|
||||
<div
|
||||
className="overflow-hidden rounded-xl border"
|
||||
style={{
|
||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="flex items-center gap-2.5 px-4 py-3"
|
||||
style={{
|
||||
background: "linear-gradient(140deg, #5a2d82 0%, #6b3a9e 20%, #7d47b8 40%, #8f54d0 60%, #7d47b8 75%, #6b3a9e 90%, #5a2d82 100%)",
|
||||
background:
|
||||
"linear-gradient(140deg, #5a2d82 0%, #6b3a9e 20%, #7d47b8 40%, #8f54d0 60%, #7d47b8 75%, #6b3a9e 90%, #5a2d82 100%)",
|
||||
}}
|
||||
>
|
||||
<Image src="/assets/images/icons/star.gif" alt="" width={18} height={18} unoptimized />
|
||||
<h2 className="text-sm font-bold text-white" style={{ fontFamily: "var(--font-nunito)" }}>
|
||||
<Image
|
||||
src="/assets/images/icons/star.gif"
|
||||
alt=""
|
||||
width={18}
|
||||
height={18}
|
||||
unoptimized
|
||||
/>
|
||||
<h2
|
||||
className="text-sm font-bold text-white"
|
||||
style={{ fontFamily: "var(--font-nunito)" }}
|
||||
>
|
||||
{t("changeMotto")}
|
||||
</h2>
|
||||
</div>
|
||||
@@ -152,7 +213,10 @@ export default async function SettingsPage() {
|
||||
className="p-5"
|
||||
style={{ backgroundColor: "var(--color-surface)" }}
|
||||
>
|
||||
<p className="text-xs mb-4" style={{ color: "var(--color-text-muted)" }}>
|
||||
<p
|
||||
className="text-xs mb-4"
|
||||
style={{ color: "var(--color-text-muted)" }}
|
||||
>
|
||||
{t("changeMottoSubtitle")}
|
||||
</p>
|
||||
<form
|
||||
@@ -170,7 +234,8 @@ export default async function SettingsPage() {
|
||||
style={{
|
||||
backgroundColor: "var(--color-background)",
|
||||
color: "var(--color-text-readable)",
|
||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 25%, transparent)",
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 25%, transparent)",
|
||||
}}
|
||||
/>
|
||||
<div>
|
||||
@@ -180,7 +245,8 @@ export default async function SettingsPage() {
|
||||
style={{
|
||||
background: "var(--color-primary)",
|
||||
color: "var(--color-primary-foreground)",
|
||||
boxShadow: "0 4px 20px color-mix(in srgb, var(--color-primary) 30%, transparent)",
|
||||
boxShadow:
|
||||
"0 4px 20px color-mix(in srgb, var(--color-primary) 30%, transparent)",
|
||||
}}
|
||||
>
|
||||
{t("saveMotto")}
|
||||
@@ -196,17 +262,28 @@ export default async function SettingsPage() {
|
||||
<div
|
||||
className="overflow-hidden rounded-xl border"
|
||||
style={{
|
||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="flex items-center gap-2.5 px-4 py-3"
|
||||
style={{
|
||||
background: "linear-gradient(140deg, #0A1F0A 0%, #0F2D0F 20%, #153C15 40%, #1B4A1B 60%, #205820 75%, #1A4A1A 90%, #143814 100%)",
|
||||
background:
|
||||
"linear-gradient(140deg, #0A1F0A 0%, #0F2D0F 20%, #153C15 40%, #1B4A1B 60%, #205820 75%, #1A4A1A 90%, #143814 100%)",
|
||||
}}
|
||||
>
|
||||
<Image src="/assets/images/icons/navigation/goody.png" alt="" width={18} height={18} unoptimized />
|
||||
<h2 className="text-sm font-bold text-white" style={{ fontFamily: "var(--font-nunito)" }}>
|
||||
<Image
|
||||
src="/assets/images/icons/navigation/goody.png"
|
||||
alt=""
|
||||
width={18}
|
||||
height={18}
|
||||
unoptimized
|
||||
/>
|
||||
<h2
|
||||
className="text-sm font-bold text-white"
|
||||
style={{ fontFamily: "var(--font-nunito)" }}
|
||||
>
|
||||
{t("securityTitle")}
|
||||
</h2>
|
||||
</div>
|
||||
@@ -214,16 +291,21 @@ export default async function SettingsPage() {
|
||||
className="p-5"
|
||||
style={{ backgroundColor: "var(--color-surface)" }}
|
||||
>
|
||||
<p className="text-xs mb-4" style={{ color: "var(--color-text-muted)" }}>
|
||||
<p
|
||||
className="text-xs mb-4"
|
||||
style={{ color: "var(--color-text-muted)" }}
|
||||
>
|
||||
{t("securityDescription")}
|
||||
</p>
|
||||
<Link
|
||||
href="/settings/2fa"
|
||||
className="inline-flex items-center gap-2 font-bold text-sm px-5 py-2.5 rounded-xl border-2 transition-all duration-200 hover:scale-[1.03] active:scale-95 backdrop-blur-sm"
|
||||
style={{
|
||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 20%, transparent)",
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 20%, transparent)",
|
||||
color: "var(--color-text-readable)",
|
||||
background: "color-mix(in srgb, var(--color-surface) 50%, transparent)",
|
||||
background:
|
||||
"color-mix(in srgb, var(--color-surface) 50%, transparent)",
|
||||
}}
|
||||
>
|
||||
{t("twoFactorLink")}
|
||||
@@ -238,7 +320,8 @@ export default async function SettingsPage() {
|
||||
href="/settings/sessions"
|
||||
className="block overflow-hidden rounded-xl border transition-all duration-200 hover:shadow-lg hover:-translate-y-0.5"
|
||||
style={{
|
||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
@@ -248,20 +331,38 @@ export default async function SettingsPage() {
|
||||
<div className="flex items-center gap-3">
|
||||
<div
|
||||
className="w-10 h-10 rounded-xl flex items-center justify-center"
|
||||
style={{ background: "color-mix(in srgb, var(--color-primary) 14%, transparent)" }}
|
||||
style={{
|
||||
background:
|
||||
"color-mix(in srgb, var(--color-primary) 14%, transparent)",
|
||||
}}
|
||||
>
|
||||
<Image src="/assets/images/icons/navigation/community.png" alt="" width={20} height={20} unoptimized />
|
||||
<Image
|
||||
src="/assets/images/icons/navigation/community.png"
|
||||
alt=""
|
||||
width={20}
|
||||
height={20}
|
||||
unoptimized
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<span className="text-sm font-extrabold" style={{ color: "var(--color-text-readable)" }}>
|
||||
<span
|
||||
className="text-sm font-extrabold"
|
||||
style={{ color: "var(--color-text-readable)" }}
|
||||
>
|
||||
Session Management
|
||||
</span>
|
||||
<p className="text-xs mt-0.5" style={{ color: "var(--color-text-muted)" }}>
|
||||
<p
|
||||
className="text-xs mt-0.5"
|
||||
style={{ color: "var(--color-text-muted)" }}
|
||||
>
|
||||
View active sessions and sign out everywhere
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<span className="text-lg font-bold" style={{ color: "var(--color-text-muted)" }}>
|
||||
<span
|
||||
className="text-lg font-bold"
|
||||
style={{ color: "var(--color-text-muted)" }}
|
||||
>
|
||||
→
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -86,11 +86,7 @@ export default async function SessionsPage({
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
<ContentCard
|
||||
icon="🔐"
|
||||
title={t("title")}
|
||||
subtitle={t("subtitle")}
|
||||
/>
|
||||
<ContentCard icon="🔐" title={t("title")} subtitle={t("subtitle")} />
|
||||
|
||||
<ContentCard
|
||||
icon="🚪"
|
||||
@@ -104,7 +100,11 @@ export default async function SessionsPage({
|
||||
</form>
|
||||
</ContentCard>
|
||||
|
||||
<ContentCard icon="✅" title={t("recentTitle")} padded={logins.length === 0}>
|
||||
<ContentCard
|
||||
icon="✅"
|
||||
title={t("recentTitle")}
|
||||
padded={logins.length === 0}
|
||||
>
|
||||
{logins.length === 0 ? (
|
||||
<EmptyState icon="🔐">{t("recentEmpty")}</EmptyState>
|
||||
) : (
|
||||
@@ -148,7 +148,11 @@ export default async function SessionsPage({
|
||||
{failed.map((f) => (
|
||||
<tr key={f.id}>
|
||||
<td className="muted" style={{ whiteSpace: "nowrap" }}>
|
||||
{formatDate(typeof f.attempted_at === "string" ? new Date(f.attempted_at) : f.attempted_at)}
|
||||
{formatDate(
|
||||
typeof f.attempted_at === "string"
|
||||
? new Date(f.attempted_at)
|
||||
: f.attempted_at,
|
||||
)}
|
||||
</td>
|
||||
<td className="muted">{f.ip_address}</td>
|
||||
</tr>
|
||||
|
||||
Reference in new issue
Block a user