Skip to content

Commit

Permalink
强制修改jwt.secret
Browse files Browse the repository at this point in the history
  • Loading branch information
TruthHun committed May 7, 2024
1 parent 40c397f commit 9b46143
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,9 @@ func runServer() {
fmt.Println("exit.")
os.Exit(0)
}()

if cfg.JWT.Secret == "" || cfg.JWT.Secret == "moredoc" {
logger.Fatal("JWT.Secret", zap.String("安全风险提示", "JWT.Secret不能为空也不能为moredoc,请修改以保证安全性!!!"))
}
service.Run(cfg, logger)
}

0 comments on commit 9b46143

Please sign in to comment.