Skip to content

Commit

Permalink
chore: add UNDB_COOKIE_DOMAIN env
Browse files Browse the repository at this point in the history
  • Loading branch information
nichenqin committed Aug 10, 2024
1 parent 92c5274 commit 13cb8b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions apps/backend/src/modules/auth/auth.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const createLuciaWithAdapter = (adapter: Adapter) => {
sessionCookie: {
attributes: {
secure: Bun.env.NODE_ENV === "PRODUCTION", // set `Secure` flag in HTTPS
domain: Bun.env.UNDB_COOKIE_DOMAIN,
},
},
getSessionAttributes: (attributes) => {
Expand Down
3 changes: 2 additions & 1 deletion packages/env/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ export const env = createEnv({
clientPrefix: "UNDB_PUBLIC_",
client: {},
server: {
UNDB_BASE_URL: z.string().optional().default('http://localhost:3721'),
UNDB_BASE_URL: z.string().optional().default("http://localhost:3721"),
UNDB_COOKIE_DOMAIN: z.string().optional(),
},
runtimeEnv: import.meta.env,
emptyStringAsUndefined: true,
Expand Down

0 comments on commit 13cb8b7

Please sign in to comment.