Skip to content

Commit 1c8d430

Browse files
Merge pull request #119 from autonomys/fix/support-for-www
Fix: Add support for www.
2 parents 64655a5 + 3eda3cc commit 1c8d430

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

web-app/.env.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ TWITTER_CLIENT_SECRET=""
1313

1414
NEXTAUTH_SECRET=""
1515
NEXTAUTH_URL="http://localhost:3000/"
16+
COOKIE_DOMAIN=".autonomysfaucet.xyz"
1617

1718
PRIVATE_KEY=""
1819
NEXT_PUBLIC_RPC_ENDPOINT=""

web-app/app/api/auth/[...nextauth]/route.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,18 @@ const authOptions: AuthOptions = {
8989
session.user = token
9090
return session
9191
}
92+
},
93+
cookies: {
94+
sessionToken: {
95+
name: 'next-auth.session-token',
96+
options: {
97+
httpOnly: true,
98+
sameSite: 'lax',
99+
path: '/',
100+
secure: process.env.NODE_ENV === 'production',
101+
domain: process.env.COOKIE_DOMAIN || undefined
102+
}
103+
}
92104
}
93105
}
94106

0 commit comments

Comments
 (0)