it requires a websiteUrl and it needs to be hardcoded into a config file that is deployed with the l...
a
it requires a websiteUrl and it needs to be hardcoded into a config file that is deployed with the lambda. But I want to be able to test this lambda from localhost:9000 as well as localhost:8080 as well as somesite.sometld/whatever
r
Hey! So you can set the websiteUrl to your prod app. And sent cookieSameSite to none in session.init on the backend.
This will allow you to create a session etc.. the only thing that won’t work are links like reset password or email verification links. Since they will point to ur prod website domain.
But you can fix that too by overriding the emailDelivery config and changing the link’s domain part on the fly
a
ok, so in the init, inside the lambda we set the websiteUrl to the actual url, but then we set what in recipeList[Session.init({})]?
I don't see cookieSameSite
r
It’s in the session.init({cookieSameSite: “none”})
a
got it, so we set it to none
what should the front-end send for websiteUrl?
r
Frontend should be whatever the frontend is loaded on.
a
so it can be localhost even though the backend lambda has somesite.whatever
r
Yea.
a
ok, and do I have easy access to what the front-end sent when I'm generating links?
r
Yes. You have access to the request object
a
so that I can generate the links dynamically with whatever the frontend sent me in websiteDomain
r
Yes. It would be in the userContext object which is one of the inputs to the emailDelivery’s sendEmail function
a
cool, thanks
@Roy R