1
0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2025-12-16 03:08:47 +00:00

Add settings restore link

This commit is contained in:
Cadence Ember
2020-06-19 19:12:43 +12:00
parent 21875a8e83
commit 0c16c027e9
4 changed files with 34 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
const crypto = require("crypto")
const {parse} = require("cookie")
const {parse: parseCookie} = require("cookie")
const constants = require("../../../lib/constants")
const db = require("../../../lib/db")
@@ -22,7 +22,7 @@ function addDefaults(input = {}) {
function getToken(req) {
if (!req.headers.cookie) return null
const cookie = parse(req.headers.cookie)
const cookie = parseCookie(req.headers.cookie)
const token = cookie.settings
if (token) return token
else return null