Skip to content

Commit

Permalink
Added constatnts
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubhrajyoti-Dey-FrosTiK committed Jan 28, 2024
1 parent f7289dd commit 66a6d5a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions constants/middleware.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package constants

const SESSION_STUDENT = "SESSION_STUDENT"
3 changes: 2 additions & 1 deletion handler/middleware.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package handler

import (
"github.com/FrosTiK-SD/authV2/constants"
"github.com/gin-gonic/gin"
)

Expand All @@ -21,7 +22,7 @@ func (h *Handler) GinVerifyStudent(ctx *gin.Context) {
student := currentHandler.Session.Student

if student != nil {
ctx.Set("student", student)
ctx.Set(constants.SESSION_STUDENT, student)
ctx.Next()
}
}

0 comments on commit 66a6d5a

Please sign in to comment.