Skip to content

Commit

Permalink
Restrict jwt verifier to Bearer type
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Feb 16, 2022
1 parent 24c94c3 commit e1fe56f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions common/service/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ func JWTHttpWrapper(h http.Handler) http.Handler {
if val, ok1 := r.Header["Authorization"]; ok1 {

whole := strings.Join(val, "")
if !strings.HasPrefix(whole, "Bearer ") {
h.ServeHTTP(w, r)
return
}
rawIDToken := strings.TrimPrefix(strings.Trim(whole, ""), "Bearer ")
//var claims claim.Claims
var err error
Expand Down

0 comments on commit e1fe56f

Please sign in to comment.