FIX - Backend for deployment
This commit is contained in:
@@ -30,8 +30,10 @@ export async function signinController(req, res) {
|
||||
const { email, password } = req.body;
|
||||
const { token, userData } = await signinService(email, password);
|
||||
res.cookie("livepoll-access-token", token, {
|
||||
httpOnly: true,
|
||||
maxAge: 10 * 24 * 60 * 60 * 1000, // 10 days
|
||||
httpOnly: true,
|
||||
secure: true,
|
||||
sameSite: "None",
|
||||
path: "/"
|
||||
}).status(200).json({
|
||||
success : true,
|
||||
message : "User signedin successfully.",
|
||||
|
||||
@@ -20,18 +20,22 @@ app.use('/docs', swaggerUi.serve, swaggerUi.setup(swaggerDocs));
|
||||
const io = new Server(httpServer, {
|
||||
cors: {
|
||||
origin: CLIENT_URL,
|
||||
methods: ["GET", "POST", "PUT", "DELETE"]
|
||||
methods: ["GET", "POST", "PUT", "DELETE"],
|
||||
credentials: true
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
handlePollSocket(io);
|
||||
|
||||
|
||||
app.use(cookieParser());
|
||||
app.use(cors({
|
||||
origin: CLIENT_URL,
|
||||
credentials: true
|
||||
}))
|
||||
app.use(cors(
|
||||
{
|
||||
origin: CLIENT_URL,
|
||||
credentials: true,
|
||||
}
|
||||
))
|
||||
app.use(express.json())
|
||||
app.get("/ping", (_req, res) => {
|
||||
res.json({ message: "pong" })
|
||||
|
||||
Reference in New Issue
Block a user