Skip to content
Snippets Groups Projects
Commit fd7f7c20 authored by Josh Everett's avatar Josh Everett
Browse files

TS syntax -> JS

parent 2f1e3f08
No related branches found
No related tags found
No related merge requests found
const express = require('express') const express = require('express')
const router = express.Router() const router = express.Router()
const Notification = require('../schema/schema') const Notification = require('../schema/schema')
import { decode } from "jwt-simple"; const jwt = require("jwt-simple");
// Recieve the notifaction // Recieve the notifaction
// user id, title, description // user id, title, description
...@@ -34,7 +34,7 @@ router.get("/info", async (req, res) => { ...@@ -34,7 +34,7 @@ router.get("/info", async (req, res) => {
const token = req.headers.authorization.split(" ")[1]; const token = req.headers.authorization.split(" ")[1];
// Decode this token with the secret key // 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. // Get the user id from the decoded token payload.
const userId = payload.id; const userId = payload.id;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment