Skip to content

Commit

Permalink
Woopsie
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisMayo committed Sep 11, 2023
1 parent cb00df6 commit 6996fd6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/classes/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ import {
UseCustomLobbyResponse,
} from "../types/custom-lobby-types";
import { Request, Response } from "express";
import jwt, { JwtPayload } from 'jsonwebtoken';

import { Collections } from "./database";
import { DBConstants } from "./constants";
import { Document } from "@seald-io/nedb";
import { User } from "../database/database.interface";
import { db } from "..";
import jwt, { JwtPayload } from 'jsonwebtoken';
import jwt_to_pem from 'jwk-to-pem';
import randomstring from "randomstring";

Expand Down Expand Up @@ -104,7 +104,7 @@ export class Handler {
} else {
id = (await collection.insertAsync({ displayName: name, epicId }))._id;
}
const sign = jwt.sign(id, db.token, {expiresIn: '24h'});
const sign = jwt.sign(id, db.token);
response.send({
data: {
displayName: name,
Expand Down Expand Up @@ -345,6 +345,7 @@ export class Handler {
id = jwt.verify(token!, db.token) as string;
console.log(id);
} catch (e) {
console.log("INVALID USER TOKEN", token)
throw new Error("401");
}
return id;
Expand Down

0 comments on commit 6996fd6

Please sign in to comment.