Skip to content

Commit

Permalink
Trying to fix fiber middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubhrajyoti-Dey-FrosTiK committed Feb 6, 2024
1 parent ce8a608 commit 1c6243f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion handler/fiber-middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package handler

import (
"errors"
"net/http"
"net/http/httptest"

"github.com/FrosTiK-SD/auth/constants"
Expand All @@ -26,7 +27,11 @@ func (h *Handler) FiberVerifyStudent(ctx *fiber.Ctx) error {
}

context, _ := gin.CreateTestContext(httptest.NewRecorder())
context.Request.Header.Add("token", token)
context.Request = &http.Request{
Header: http.Header{
"token": []string{token},
},
}

currentHandler.HandlerVerifyStudentIdToken(context)
student := currentHandler.Session.Student
Expand Down

0 comments on commit 1c6243f

Please sign in to comment.