Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion signing/infrastructure/accesstokenimpl/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type Config struct {

func (cfg *Config) SetDefault() {
if cfg.Expire <= 0 {
cfg.Expire = 5
cfg.Expire = 60

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

为了提高代码的可读性和可维护性,建议将 60 这个魔术数字提取为一个具名常量。例如,可以在文件顶部定义 const defaultTokenGracePeriodInSeconds = 60,然后在此处使用该常量。这能更清晰地表达这个值的含义(token 的宽限期),并且方便未来统一修改。

}
}

Expand Down
Loading