Skip to content

Commit a6f5e82

Browse files
fixing token related bug
1 parent 227aa6c commit a6f5e82

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

admin/src/pages/Announcement.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const Announcement = () => {
7171
<div className="flex flex-col items-center justify-center">
7272
<div className="text-center mb-5">
7373
<div className="inline-flex justify-center items-center gap-4 ml-56 bg-white px-6 py-3 rounded-xl shadow-md border border-violet-100">
74-
<h1 className="text-3xl font-semibold text-violet-700">
74+
<h1 className="text-3xl ml-10 font-semibold text-violet-700">
7575
Post College Announcement
7676
</h1>
7777
<img className="w-16 h-16 object-contain" src={scholar} alt="Scholar icon" />
@@ -137,7 +137,7 @@ const Announcement = () => {
137137
onChange={(e) => {
138138
setBranch(e.target.value);
139139
}}
140-
className="w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-violet-500 focus:border-transparent transition-all duration-200 bg-gray-50 hover:bg-gray-100"
140+
className="w-full outline-none p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-violet-500 focus:border-transparent transition-all duration-200 bg-gray-50 hover:bg-gray-100"
141141
/>
142142

143143
<textarea
@@ -148,7 +148,7 @@ const Announcement = () => {
148148
}}
149149
placeholder="Enter Announcement Description"
150150
rows="6"
151-
className="w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-violet-500 focus:border-transparent transition-all duration-200 bg-gray-50 hover:bg-gray-100 resize-none"
151+
className="w-full outline-none p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-violet-500 focus:border-transparent transition-all duration-200 bg-gray-50 hover:bg-gray-100 resize-none"
152152
></textarea>
153153
</div>
154154

server/controllers/adminController.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ const collegeLogin = async(req,res)=>{
8888
}
8989

9090
const token = jwt.sign({email:email,collegeId:college._id,role:college.role},
91-
process.env.JWT_SECRET,
92-
{expiresIn:"1d"}
91+
process.env.JWT_SECRET
92+
9393
);
9494

9595
res.cookie("token",token,{
9696
httpOnly:true,
9797
secure:process.env.NODE_ENV==="production"?true:false,
9898
sameSite:process.env.NODE_ENV==="production"?"none":"lax",
99-
maxAge: 24 * 60 * 60 * 1000, // 1 day in milliseconds
99+
// maxAge: 24 * 60 * 60 * 1000, // 1 day in milliseconds
100100
path: '/', // Apply to all paths
101101
overwrite: true // Ensure it overwrites any existing token cookie
102102
})

server/controllers/userController.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ const loginUser = async (req, res) => {
4040
}
4141
const token = jwt.sign(
4242
{ email: email, userId: user._id },
43-
process.env.JWT_SECRET,
44-
{ expiresIn: "1d" }
43+
process.env.JWT_SECRET
44+
4545
);
4646

4747
res.cookie("token", token, {

0 commit comments

Comments
 (0)