add cookie path property (#8594)

played around with that example and was wondering why it didn't work any more when having an `auth/login` page.

I hope this addition will spare someone else some confusion :)
This commit is contained in:
Lukas Strassel 2019-09-02 20:30:29 +02:00 committed by Luis Alvarez D
parent 4a1215b701
commit 83a10eefee

View file

@ -24,7 +24,8 @@ const RegisterBox = () => {
const onCompleted = data => { const onCompleted = data => {
// Store the token in cookie // Store the token in cookie
document.cookie = cookie.serialize('token', data.signinUser.token, { document.cookie = cookie.serialize('token', data.signinUser.token, {
maxAge: 30 * 24 * 60 * 60 // 30 days maxAge: 30 * 24 * 60 * 60, // 30 days
path: '/' // make cookie available for all routes underneath "/"
}) })
// Force a reload of all the current queries now that the user is // Force a reload of all the current queries now that the user is
// logged in // logged in