Skip to content

Commit

Permalink
Merge pull request #49 from OOrangeeee/online/deploy-debug
Browse files Browse the repository at this point in the history
feat(ci/cd):add (ci/cd)
  • Loading branch information
OOrangeeee authored Oct 14, 2024
2 parents 2605661 + 04715aa commit a0c0ca4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/configs/middlewareConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ func InitMiddleware(e *echo.Echo) {
return false
},
SigningKey: func(c echo.Context) interface{} {
utils.Log.WithFields(logrus.Fields{
"jwtSecret": viper.GetString("jwt.jwtSecret"),
}).Info("JWT Secret")

return []byte(viper.GetString("jwt.jwtSecret"))
},
TokenLookup: "header:Authorization:Bearer ",
Expand Down
5 changes: 5 additions & 0 deletions internal/utils/jwtTool.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package utils
import (
"SEP/internal/models/dataModels"
"github.com/golang-jwt/jwt/v5"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"time"
)
Expand All @@ -18,6 +19,10 @@ func (j *JwtTool) GenerateLoginToken(user *dataModels.User) (string, error) {
}
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
t, err := token.SignedString([]byte(viper.GetString("jwt.jwtSecret")))
Log.WithFields(logrus.Fields{
"jwtToken": t,
"jwtsecret": viper.GetString("jwt.jwtSecret"),
}).Info("JWT Token in log in")
if err != nil {
return "", err
}
Expand Down

0 comments on commit a0c0ca4

Please sign in to comment.