Skip to content

Commit e6ace17

Browse files
committed
Add required file_token to cookies
1 parent b0e3f0a commit e6ace17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎notion-backup.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ let axios = require('axios')
88
, { mkdir, rm, readdir } = require('fs/promises')
99
, { join } = require('path')
1010
, notionAPI = 'https://www.notion.so/api/v3'
11-
, { NOTION_TOKEN, NOTION_SPACE_ID } = process.env
11+
, { NOTION_TOKEN, NOTION_FILE_TOKEN, NOTION_SPACE_ID } = process.env
1212
, client = axios.create({
1313
baseURL: notionAPI,
1414
headers: {
15-
Cookie: `token_v2=${NOTION_TOKEN}`
15+
Cookie: `token_v2=${NOTION_TOKEN}; file_token=${NOTION_FILE_TOKEN}`
1616
},
1717
})
1818
, die = (str) => {
@@ -22,7 +22,7 @@ let axios = require('axios')
2222
;
2323

2424
if (!NOTION_TOKEN || !NOTION_SPACE_ID) {
25-
die(`Need to have both NOTION_TOKEN and NOTION_SPACE_ID defined in the environment.
25+
die(`Need to have NOTION_TOKEN, NOTION_FILE_TOKEN and NOTION_SPACE_ID defined in the environment.
2626
See https://medium.com/@arturburtsev/automated-notion-backups-f6af4edc298d for
2727
notes on how to get that information.`);
2828
}

0 commit comments

Comments
 (0)