Skip to content

Secure way to configure lucia when dealing with multiple apps running in different sub-domains #955

Answered by pilcrowonpaper
prabak asked this question in Help
Discussion options

You must be logged in to vote

Setting SameSite: Strict means your users won't be logged in if they access your website via a link. That's fine for say banks, but I don't think that's what you want for the majority of websites.

Assuming Lucia will be initialized in auth.myapp.com, you can omit auth since that's included by default.

csrfProtection: {
    allowedSubdomains: ['web', 'api']
}

Domain cookie attribute should only be set if you're planning to read session cookies on the server on web.myapp.com and api.myapp.com.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by prabak
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants