feat: Enable host trust for authentication and update example environment configuration

- Set AUTH_TRUST_HOST to true in env.example for improved security.
- Updated NextAuth configuration to trust the host during authentication.
This commit is contained in:
ilia 2026-01-04 11:01:00 -05:00
parent af2faf8f41
commit 888ffef8e3
2 changed files with 2 additions and 0 deletions

View File

@ -4,6 +4,7 @@ DATABASE_URL="postgresql://user:password@localhost:5432/mirrormatch?schema=publi
# NextAuth # NextAuth
NEXTAUTH_URL="http://localhost:3000" NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secret-key-here-generate-with-openssl-rand-base64-32" NEXTAUTH_SECRET="your-secret-key-here-generate-with-openssl-rand-base64-32"
AUTH_TRUST_HOST=true
# Email Configuration (for production) # Email Configuration (for production)
SMTP_HOST="smtp.example.com" SMTP_HOST="smtp.example.com"

View File

@ -9,6 +9,7 @@ if (!nextAuthSecret) {
} }
export const { handlers, auth, signIn, signOut } = NextAuth({ export const { handlers, auth, signIn, signOut } = NextAuth({
trustHost: true,
providers: [ providers: [
Credentials({ Credentials({
name: "Credentials", name: "Credentials",