Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

fix auth locally

Bill Yange61ec2853137
diff --git a/server/src/lib/auth.ts b/server/src/lib/auth.ts
index e707f02f2..5019ae53f 100644
--- a/server/src/lib/auth.ts
+++ b/server/src/lib/auth.ts
@@ -24,5 +24,14 @@ export const initAuth = (allowList: string[]) => {
},
plugins: [username()],
trustedOrigins: allowList,
+ advanced: {
+ useSecureCookies: process.env.NODE_ENV === "production", // don't mark Secure in dev
+ defaultCookieAttributes: {
+ sameSite: process.env.NODE_ENV === "production" ? "none" : "lax",
+ path: "/",
+ // httpOnly: true is default
+ // secure: false (implied by useSecureCookies false)
+ },
+ },
});
};