Skip to content

Commit

Permalink
Merge pull request #17 from Felix221123/develop
Browse files Browse the repository at this point in the history
Test cases
  • Loading branch information
Felix221123 authored Oct 2, 2024
2 parents 5158bef + 664eee0 commit 6d7789c
Show file tree
Hide file tree
Showing 8 changed files with 822 additions and 859 deletions.
2 changes: 1 addition & 1 deletion backend/__tests__/_BoardTests_/CreateBoard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test('Should create a new board for the user', async () => {
firstName: 'John',
lastName: 'Doe',
emailAddress: 'john@example.com',
password: 'hashedpassword',
password: 'hashedPassword',
boards: [],
}) as Document;

Expand Down
458 changes: 238 additions & 220 deletions backend/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"server": "nodemon",
"lint": "eslint src/**/*.ts",
"lint:fix": "eslint src/**/*.ts --fix",
"build": "tsc --out dist",
"build": "tsc",
"format:style": "prettier . --write"
},
"keywords": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import signJWT from "../../Functions/signJWT";
import config from "../../Config/config";



const UpdatePasswordForLoggedInUsersController:RequestHandler = async (req: Request, res: Response, _next: NextFunction) => {

// creating a password body structuring
Expand Down Expand Up @@ -44,7 +43,7 @@ const UpdatePasswordForLoggedInUsersController:RequestHandler = async (req: Requ
await user.save();

// Remove the password from the user object before returning it
const userWithoutPassword = {
const userWithoutPassword:any = {
_id: user._id,
emailAddress: user.emailAddress,
firstName: user.firstName,
Expand All @@ -53,7 +52,8 @@ const UpdatePasswordForLoggedInUsersController:RequestHandler = async (req: Requ
createdAt: user.createdAt,
updatedAt: user.updatedAt,
__v: user.__v,
};
};;


// Issue a new JWT after password update
signJWT(user, (error, token) => {
Expand Down
1 change: 1 addition & 0 deletions backend/src/Functions/UserValidToken.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { NextFunction, Request, Response } from 'express';
import logging from '../Config/logging';


const NAMESPACE = 'user';

const ValidateToken = (req: Request, res: Response, _next: NextFunction) => {
Expand Down
1 change: 1 addition & 0 deletions backend/src/Interface/UserProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface IUser extends Document {
currentSessionToken:string | null;
createdAt: Date;
updatedAt: Date;
__v?: number;
}


Expand Down
Loading

0 comments on commit 6d7789c

Please sign in to comment.