feat: add robotId cookie and redirect
This commit is contained in:
@@ -380,11 +380,19 @@ router.get(
|
||||
httpOnly: false,
|
||||
maxAge: 60000,
|
||||
}); // 1-minute expiration
|
||||
res.cookie("robot_auth_message", "Robot successfully authenticated", {
|
||||
// res.cookie("robot_auth_message", "Robot successfully authenticated", {
|
||||
// httpOnly: false,
|
||||
// maxAge: 60000,
|
||||
// });
|
||||
res.cookie('robot_auth_robotId', robotId, {
|
||||
httpOnly: false,
|
||||
maxAge: 60000,
|
||||
});
|
||||
res.redirect(`${process.env.PUBLIC_URL}/robots/${robotId}/integrate` as string || `http://localhost:5173/robots/${robotId}/integrate`);
|
||||
|
||||
const baseUrl = process.env.PUBLIC_URL || "http://localhost:5173";
|
||||
const redirectUrl = `${baseUrl}/robots/`;
|
||||
|
||||
res.redirect(redirectUrl);
|
||||
} catch (error: any) {
|
||||
res.status(500).json({ message: `Google OAuth error: ${error.message}` });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user