From ac25c03de7f84aece72ad7e7702165da4f258776 Mon Sep 17 00:00:00 2001 From: RohitR311 Date: Wed, 6 Nov 2024 20:25:07 +0530 Subject: [PATCH] feat: redirect to localhost:5173 --- server/src/routes/auth.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/server/src/routes/auth.ts b/server/src/routes/auth.ts index 9240cc0c..2e922d57 100644 --- a/server/src/routes/auth.ts +++ b/server/src/routes/auth.ts @@ -333,12 +333,14 @@ router.get('/google/callback', requireSignIn, async (req: AuthenticatedRequest, const jwtToken = jwt.sign({ userId: user.id }, process.env.JWT_SECRET as string, { expiresIn: '12h' }); res.cookie('token', jwtToken, { httpOnly: true }); - res.json({ - message: 'Google authentication successful', - google_sheet_email: robot.google_sheet_email, - jwtToken, - files - }); + // res.json({ + // message: 'Google authentication successful', + // google_sheet_email: robot.google_sheet_email, + // jwtToken, + // files + // }); + + res.redirect(`http://localhost:5173`); } catch (error: any) { res.status(500).json({ message: `Google OAuth error: ${error.message}` }); }