aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/utils.js')
-rw-r--r--src/lib/utils.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/utils.js b/src/lib/utils.js
index 65025c3a..712ce8f5 100644
--- a/src/lib/utils.js
+++ b/src/lib/utils.js
@@ -126,3 +126,8 @@ export const login = async (user, setHeaders) => {
})
});
};
+
+export const auth = (req) => {
+ let { token } = cookie.parse(req.headers.get('cookie') || '');
+ return { authorization: `Bearer ${token}` };
+};