1
0
Fork 0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2026-03-29 15:51:35 +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
No known key found for this signature in database
GPG key ID: 128B99B1B74A6412
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