From f2234482e562178772744581f6619d79908bcd47 Mon Sep 17 00:00:00 2001 From: Mong Israel Date: Wed, 31 Jul 2024 01:32:04 +0100 Subject: [PATCH 1/2] fixed auth token timer --- src/index.ts | 7 ++++++- src/services/auth.services.ts | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index cdb91134..da007ff6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -92,8 +92,13 @@ AppDataSource.initialize() .then(async () => { // await seed(); server.use(express.json()); + // server.get("/", (req: Request, res: Response) => { + // // res.send("Hello world"); + // res.send("Hello world"); + // }); server.get("/", (req: Request, res: Response) => { - res.send("Hello world"); + // res.send("Hello world"); + res.send({ message: "I am the express API responding for team panther" }); }); server.get("/probe", (req: Request, res: Response) => { diff --git a/src/services/auth.services.ts b/src/services/auth.services.ts index f07324a5..55500b4b 100644 --- a/src/services/auth.services.ts +++ b/src/services/auth.services.ts @@ -27,13 +27,13 @@ export class AuthService implements IAuthService { } const hashedPassword = await hashPassword(password); const otp = generateNumericOTP(6); - const otpExpires = new Date(Date.now() + 10 * 60 * 1000); + const otpExpires = new Date(Date.now() + 24 * 3600 * 1000); const user = new User(); user.name = `${first_name} ${last_name}`; user.email = email; user.password = hashedPassword; user.profile = new Profile(); - user.profile.first_name = last_name; + user.profile.first_name = first_name; user.profile.last_name = last_name; user.profile.avatarUrl = ""; user.otp = parseInt(otp); From 953e8941061c3910470fce4c6e548134b5d26fb6 Mon Sep 17 00:00:00 2001 From: James Ayomikun Araoye Date: Wed, 31 Jul 2024 01:45:09 +0100 Subject: [PATCH 2/2] Update auth.services.ts --- src/services/auth.services.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/auth.services.ts b/src/services/auth.services.ts index 55500b4b..98c1d0f0 100644 --- a/src/services/auth.services.ts +++ b/src/services/auth.services.ts @@ -27,7 +27,7 @@ export class AuthService implements IAuthService { } const hashedPassword = await hashPassword(password); const otp = generateNumericOTP(6); - const otpExpires = new Date(Date.now() + 24 * 3600 * 1000); + const otpExpires = new Date(Date.now() + 10 * 60 * 1000); const user = new User(); user.name = `${first_name} ${last_name}`; user.email = email;