You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When deploying a Datasette instance to Vercel combined with plugins requiring the signing secret (e.g. datasette-auth-passwords):
Authentication is disconnected after navigating for a few pages
The following message appears when logging for the second time: "form-urlencoded POST field did not match cookie"
This is clearly a CSRF token issue. After some investigation, it seems the DATASETTE_SECRET environment variable is not taken into account after deployment:
datasette publish vercel command generates and sets a Vercel environment variable named DATASETTE_SECRET
In the serverless function index.py, the DATASETTE_SECRET is never picked up and a new secret is generated (DATASETTE_SECRET is only picked-up by the datasette CLI)
Quite oftern a new copy of the serverless function is called server-side thus rotating the secret automatically!
The fix seems easy enough, I'll propose a PR to fix the serverless function to pick-up the DATASETTE_SECRET env var.
The text was updated successfully, but these errors were encountered:
When deploying a Datasette instance to Vercel combined with plugins requiring the signing secret (e.g.
datasette-auth-passwords
):This is clearly a CSRF token issue. After some investigation, it seems the
DATASETTE_SECRET
environment variable is not taken into account after deployment:datasette publish vercel
command generates and sets a Vercel environment variable namedDATASETTE_SECRET
index.py
, theDATASETTE_SECRET
is never picked up and a new secret is generated (DATASETTE_SECRET
is only picked-up by thedatasette
CLI)The fix seems easy enough, I'll propose a PR to fix the serverless function to pick-up the
DATASETTE_SECRET
env var.The text was updated successfully, but these errors were encountered: