feat: redirect to localhost:5173
This commit is contained in:
@@ -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' });
|
const jwtToken = jwt.sign({ userId: user.id }, process.env.JWT_SECRET as string, { expiresIn: '12h' });
|
||||||
res.cookie('token', jwtToken, { httpOnly: true });
|
res.cookie('token', jwtToken, { httpOnly: true });
|
||||||
|
|
||||||
res.json({
|
// res.json({
|
||||||
message: 'Google authentication successful',
|
// message: 'Google authentication successful',
|
||||||
google_sheet_email: robot.google_sheet_email,
|
// google_sheet_email: robot.google_sheet_email,
|
||||||
jwtToken,
|
// jwtToken,
|
||||||
files
|
// files
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
res.redirect(`http://localhost:5173`);
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
res.status(500).json({ message: `Google OAuth error: ${error.message}` });
|
res.status(500).json({ message: `Google OAuth error: ${error.message}` });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user