From fd7f7c200edc09353cee792ab7d984c1a72e095d Mon Sep 17 00:00:00 2001 From: Josh Everett <44347292+MrJoshE@users.noreply.github.com> Date: Thu, 20 Apr 2023 15:42:57 +0100 Subject: [PATCH] TS syntax -> JS --- src/routes/notification.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/notification.js b/src/routes/notification.js index bfc85b4..b2ef76d 100644 --- a/src/routes/notification.js +++ b/src/routes/notification.js @@ -1,7 +1,7 @@ const express = require('express') const router = express.Router() const Notification = require('../schema/schema') -import { decode } from "jwt-simple"; +const jwt = require("jwt-simple"); // Recieve the notifaction // user id, title, description @@ -34,7 +34,7 @@ router.get("/info", async (req, res) => { const token = req.headers.authorization.split(" ")[1]; // Decode this token with the secret key - const payload = decode(token, secretKey, false, jwtAlgorithm); + const payload = jwt.decode(token, secretKey, false, jwtAlgorithm); // Get the user id from the decoded token payload. const userId = payload.id; -- GitLab