mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 03:27:39 +08:00
chore: updates
This commit is contained in:
@@ -26,11 +26,12 @@ func (s *Server) authModdleware(c *gin.Context) {
|
||||
|
||||
auth := c.GetHeader("Authorization")
|
||||
if auth == "" {
|
||||
log.Infof("token is not present, abort")
|
||||
c.AbortWithStatus(http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
auth = strings.TrimPrefix(auth, "Bearer ")
|
||||
log.Infof("current token: %v", auth)
|
||||
//log.Infof("current token: %v", auth)
|
||||
token, err := jwt.ParseWithClaims(auth, &jwt.RegisteredClaims{}, func(t *jwt.Token) (interface{}, error) {
|
||||
return []byte(s.jwtSerect), nil
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user