remove debugging stuff

This commit is contained in:
StarAppeal
2024-12-07 05:10:49 +01:00
parent f744424e8e
commit 9d51b17f1c
3 changed files with 2 additions and 4 deletions
+1 -3
View File
@@ -9,7 +9,7 @@ export class RestAuth {
public createRouter() {
const router = express.Router();
router.put("/register", async (req, res) => {
router.post("/register", async (req, res) => {
const username = req.body.username;
const timezone = req.body.timezone;
const location = req.body.location;
@@ -44,7 +44,6 @@ export class RestAuth {
const password = req.body.password;
const userService = await UserService.create();
const user = await userService.getUserByName(username);
console.log(user);
if (!user) {
res.status(404).send({success: false, message: "User not found", id: "username"});
@@ -58,7 +57,6 @@ export class RestAuth {
return;
}
// generate JWT token here
const jwtToken = new JwtAuthenticator(
process.env.SECRET_KEY!,
+1
View File
@@ -12,6 +12,7 @@ export function authenticateJwt(
const jwtAuthenticator = new JwtAuthenticator(
process.env.SECRET_KEY as string,
);
const decodedToken = jwtAuthenticator.verifyToken(token);
if (!decodedToken) {
return res.status(401).send("Unauthorized");
-1
View File
@@ -25,7 +25,6 @@ export class RestUser {
});
router.put("/:id", async (req, res) => {
console.log("PUT /user/:id")
const userService = await UserService.create();
const id = req.params.id;
const user = req.body as IUser;