Skip to content

Commit

Permalink
fix: cookie secure fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Raj Nandan Sharma authored and Raj Nandan Sharma committed Jan 17, 2025
1 parent 4f4d1e1 commit c20d4d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/routes/(manage)/manage/(account)/forgot/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
if (data.isSecretSet === false || data.isResendSet === false) {
data.view = "error";
data.error =
"Environment variables are not set. Read the documentation to set them. https://kener.ing/docs/environment-vars";
"Environment variables(RESEND_API_KEY, RESEND_SENDER_EMAIL) are not set. Read the documentation to set them. https://kener.ing/docs/environment-vars";
}
if (data.isSiteURLSet === false) {
Expand Down
6 changes: 4 additions & 2 deletions src/routes/(manage)/manage/(account)/signin/submit/+server.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// @ts-nocheck
import { json, redirect } from "@sveltejs/kit";
import dotenv from "dotenv";

import { base } from "$app/paths";
import db from "$lib/server/db/db.js";
import { VerifyPassword, GenerateToken, VerifyToken } from "$lib/server/controllers/controller.js";

dotenv.config();
export async function POST({ request, cookies }) {
//read form post data email and passowrd
const formdata = await request.formData();
Expand Down Expand Up @@ -38,7 +40,7 @@ export async function POST({ request, cookies }) {
path: "/" + base,
maxAge: 365 * 24 * 60 * 60, // 1 year in seconds
httpOnly: true,
secure: true,
secure: process.env.NODE_ENV === "production",
sameSite: "lax"
});

Expand Down

0 comments on commit c20d4d7

Please sign in to comment.