I'm trying to add recaptcha v3 to my express app. I tried this code:
https://github.com/Leog004/RecaptchaV3-NodeJS
read this post but it did not help:
this is what chrome says:
Because a cookie’s SameSite attribute was not set or is invalid, it defaults to SameSite=Lax, which prevents the cookie from being sent in a cross-site request. This behavior protects user data from accidentally leaking to third parties and cross-site request forgery. Resolve this issue by updating the attributes of the cookie: Specify SameSite=None and Secure if the cookie should be sent in cross-site requests. This enables third-party use. Specify SameSite=Strict or SameSite=Lax if the cookie should not be sent in cross-site requests.
This is my session configuration for saving sessions to mongodb: (I use it as app.use(session(sessionconf)) for every request in back-end)
const sessionconf = {
store: MongodbStore.create({
mongoUrl: str,
secret,
touchAfter: 24 * 60 * 60
}),
secret,
resave: false,
name: '_cloud',
saveUninitialized: false
,
cookie: {
httpOnly: true,
secure: true,
expires: Date.now() + 1000 * 60 * 60 * 1 ,
maxAge: 1000 * 60 * 60 * 1
}
}
everything looks working but when fetching the post route from the front-end, the body of post request in the back-end, shows {}