rebranding to forum, adding settings and stripe page
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import fs from 'fs/promises';
|
||||
import chalk from 'chalk';
|
||||
import path from 'path';
|
||||
import {nodeModels, edgeModels} from './model/import.js'
|
||||
import { nodeModels, edgeModels } from './model/import.js'
|
||||
import Edge from "./model/edge.js"
|
||||
import { fileURLToPath } from "url"
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
@@ -46,7 +46,12 @@ export default class Socket {
|
||||
const cookies = parseCookies(req.headers.cookie);
|
||||
const token = cookies.auth_token;
|
||||
if (!token) throw new Error("No auth token");
|
||||
const payload = jwt.verify(token, process.env.JWT_SECRET);
|
||||
let payload;
|
||||
try {
|
||||
payload = jwt.verify(token, process.env.JWT_SECRET);
|
||||
} catch(e) {
|
||||
console.error("error: jwt is expired ", e)
|
||||
}
|
||||
ws.userEmail = payload.email;
|
||||
|
||||
ws.on('message', (msg) => {
|
||||
|
||||
Reference in New Issue
Block a user