Skip to content

Commit 4f1fa31

Browse files
refactor: increase token expiration time to 1000 hours and add endpoint to retrieve students by classroom ID
1 parent b530b75 commit 4f1fa31

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/helper/token_helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func GenerateAllTokens(studentID string, name string, email string, class string
2727
Email: email,
2828
Class: class,
2929
StandardClaims: jwt.StandardClaims{
30-
ExpiresAt: time.Now().Local().Add(time.Hour * time.Duration(100)).Unix(),
30+
ExpiresAt: time.Now().Local().Add(time.Hour * time.Duration(1000)).Unix(),
3131
},
3232
}
3333

internal/routes/classroom_routes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ func ClassroomRoutesStudent(r *gin.Engine) {
1212
r.Use(middleware.AuthenticationStudent())
1313
r.GET("/classroom/join/:classroom_id", controllers.JoinClassroom())
1414
r.GET("/classroom/leave/:classroom_id", controllers.LeaveClassroom())
15+
r.GET("/classroom/get/students/:classroom_id", controllers.GetStudentsByClassroomID())
1516

1617
}
1718

@@ -22,7 +23,6 @@ func ClassroomRoutesTeacher(r *gin.Engine) {
2223
r.POST("/classroom/create/:teacher_id", controllers.CreateClassroom())
2324
r.GET("/classroom/delete/:classroom_id", controllers.DeleteClassroom())
2425
r.GET("/classroom/get/:classroom_id", controllers.GetClassroomByID())
25-
r.GET("/classroom/get/students/:classroom_id", controllers.GetStudentsByClassroomID())
2626
r.GET("/classroom/get/teachers/:classroom_id", controllers.GetTeachersByClassroomID())
2727
r.GET("/classroom/get/school/:school_code", controllers.GetClassroomsBySchoolCode())
2828
r.GET("/classroom/get/school/:school_code/:teacher_id", controllers.GetClassroomsBySchoolCodeTeacherID())

0 commit comments

Comments
 (0)