From 6444cf21ebc2f708b6fec35cc1b66d3bd546f083 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Sat, 18 Jul 2026 06:24:44 +0200 Subject: [PATCH] Added preferences and serialize to repo. Stale sessions are refreshed on restart or after a period of time now. --- components/user/preferences.vue | 94 +++++++++++++++++++++++++++++++++ src/web/serialize.js | 13 +++++ 2 files changed, 107 insertions(+) create mode 100644 components/user/preferences.vue create mode 100644 src/web/serialize.js diff --git a/components/user/preferences.vue b/components/user/preferences.vue new file mode 100644 index 0000000..a770b99 --- /dev/null +++ b/components/user/preferences.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/src/web/serialize.js b/src/web/serialize.js new file mode 100644 index 0000000..ca1a35b --- /dev/null +++ b/src/web/serialize.js @@ -0,0 +1,13 @@ +import { stringify } from '@brillout/json-serializer/stringify'; + +export default function serializeApiResponses(req, res, next) { + res.json = function json(obj) { // eslint-disable-line no-param-reassign + if (!this.get('Content-Type')) { + this.set('Content-Type', 'application/json'); + } + + return this.send(stringify(obj)); + }; + + next(); +}